1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Problem with dual boot in Ubuntu

Discussion in 'Linux and Unix' started by xico, May 2, 2010.

Thread Status:
Not open for further replies.
Advertisement
  1. xico

    xico Thread Starter

    Joined:
    Jun 29, 2002
    Messages:
    29,787
    This is the second time I mis calculated installing Ubuntu after XP and Win 7. When I get to the partitioning, I wind up with an unusuable large partition. The first time I got the message that I hadn't made a swap partition, but it wouldn't let me make a swap partition; the second time I made a swap partition, but then I wound up with a swap partition and another unusable partition that I couldn't get beyond. Hacking Ubuntu doesn't address this problem, nor does Ubuntu Hacks or Ubuntu Linux Toolbox

    What am I doing wrong?

    I've put Ubuntu single boot on several of my computers, but the dual boot is giving me problems.

    Thanks for any information to remedy this.

    xico.
     
  2. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    xico,

    The Gparted, for which in the newer versions you have to install with the Synatic Packager Manager, can resize your partitions. It is almost invented for resizing NTFS partitions and naturally can even more in Linux.

    To install it just click "System", "Administration" and "Synatic Package Manager" and search "gparted" and click "Apply".

    A longer way is to move manually the Linux to another partition of your chosen size.

    With the exception of the Red Hat family distro like Fedora, RHEL etc, all Linux I tried can be moved between partitions if you are willing to edit the /etc/fstab and /boot/grub/grub.cfg to reflect the new location. To make Ubuntu boots again you need to mount it with its Live CD, change root into it and issue "grub-install", as described in Task B5 of Just booting tips in my signature.

    The full Linux can be physically copied/moved from say sda3 (excessive size) to sda10(ideal size) by just one command
    Code:
    tar cf - . |  ( cd /mnt/sda10; tar xf -)
    after you have mounted sda3 and sda10 in /mnt and change directory to /mnt/sda3. I actually use this line to move Win7 too!

    The swap can be deleted and created with program cfdisk or fdisk. It doesn't need to be formatted. Therefore it is dead easy to change if you use the same partition number. If you create it with a different partition just edit /etc/fstab will be enough to get everything going. If you don't want to bother with troubles just nuke the swap completely and the Linux will run without it.
     
  3. xico

    xico Thread Starter

    Joined:
    Jun 29, 2002
    Messages:
    29,787
    Thanks, Saikee! That's much appreciated! Wow! Thanks!
     
  4. jiml8

    jiml8 Guest

    Joined:
    Jul 2, 2005
    Messages:
    2,634
    Make sure the Windows installation is defragged before trying to install Ubuntu. Repartitioning will fail if the resize of NTFS is such that it would corrupt the filesystem because some files would be beyond the end of the new partition.

    I *think* that GParted will handle that little item for you as part of its ntfs resize operation, but I'm not positive. I usually do that stuff the old-fashioned way, using ntfsresize.

    Also, I don't understand why Saikee has trouble moving red-hat family distros around; I do it all the time without issue.

    And is tar-cf | (etc) faster than rsync?

    edit:

    As for moving RH distros, it isn't "without issue" if fstab and grub are set up to use UUIDs. In that event, it is necessary to make the required UUID changes so the moves are properly detected.
     
  5. xico

    xico Thread Starter

    Joined:
    Jun 29, 2002
    Messages:
    29,787
    Thanks, jiml8. Defragging is an important point. I'll do that, for sure.
     
  6. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    jiml8,

    Yes I have two OSes that don't like to be shifted around between partition. Apart from the new Red Hat Enterprise Linux the other one is Vista.

    I must admit that I never use the UUID reference and change it back to the block device names that every Linux command would understand. That never trouble any other distro. before UUID was introduced all Linux could be booted. I haven't found a case where UUID must be used yet. It doesn't guarantee a Linux always boot because the boot loader needs to know the disk number correctly too.

    I suspect many moves in Linux are influenced by the MS systems as Vista/Win7 have their own GUID references which are just an excuse for bootmgr, their common boot loader, to find a Vista or Win7 from a jungle of logical partitions into which because these two systems can be installed. I have just moved a Win7 from a logical partition to another disk's logical partition by the tar copmmand, used a Linux to create a Dos partition, put bootmgr into it, repaired connection with bootsect.exe and bootrec.exe and fired up the Win7.

    The Vista and RHEL behaviours after being moved are the same. They both give the booting screen. When a user is selected they both log out immediately and back to the same log in screen. I have only recently started to investigate why these two cannot be shifted.

    These two systems or any other system can still be moved between hard disks if their original positions are unchanged. That is to said they can be cloned by dd if the target disk is an mirror image of the source. I have never had any system that cannot be cloned this way yet, even with a Xp without defraging it because nothing is changed in the new disk except the serial number of the hard disk.

    I have not compared the tar command with the rsync but I was told that the tar command preserves all the filing attributes intact. I was rather amazed that it can be used to shift a Win7, as I did it again last night.
     
  7. jiml8

    jiml8 Guest

    Joined:
    Jul 2, 2005
    Messages:
    2,634
    In the case of Vista, if you made it to the login screen, Explorer was running. You selected a user, then Explorer crashed, is what it sounds like. In the case of RHEL, I understand you to be saying you have a GUI loaded. The GUI is apparently crashing.

    For Vista, try starting in safe mode. If you have moved Vista to a new partition, you might have drive letter issues. With RHEL, I'm not sure what the problem would be. Possibly some symlinks that are not pointing properly, again causing a GUI crash.

    And rsync will certainly preserve all attributes. It wouldn't be much good if it didn't. For that matter, on any number of occasions I have copied both WinXP and various linux distros from drive to drive using cp -a which also preserves everything.

    With Windows, it often gets ugly because of drive letter issues and the registry. However I have a copy of COA2 (Change of Address) which enables me to batch-change locations in the registry. Thus, for instance, I can move a package from drive C: to drive E: and use COA2 to update the package's location in the registry. I can do the same thing with an entire OS, but that takes careful planning in advance because it WILL break and I WON'T be able to boot into it if I do it wrong.

    You can get COA2 here. I've had a copy for nearly a decade. I haven't tried it on Vista or Win7 but it worked fine as recently as WinXP. Since I now run Windows only in virtual machines, I don't need it to move an OS; moving a virtual machine is trivial. COA2 is dangerous, but I've used it quite a bit as I reorganize a Windows system. Far better than reinstalling all the packages.

    When I've copied Linux, I have often had to fix up symlinks. Commonly, for instance, if I've moved my system from /mnt/sda5 to /mnt/sdc3, I'll change fstab to mount the sda5 partition as, for instance, /mnt/newsda5, then I'll create a symlink /mnt/sda5 that points to /mnt/sdc3 thereby picking up any symlink problems associated with the move.
     
  8. saikee

    saikee

    Joined:
    Jun 11, 2004
    Messages:
    3,888
    For a moved Vista I got a perfect long in screen. When I log in as an ordinary user I could see the system starts "Preparing your desktop" and then log me off automatically. If I log in as admin after prearing the desktop I got a blank screen with just a mouse pointer. I definitely missed out something. I never get a chance to get to the Explorer.

    Strange enough I don't get this with WIn7 but my Vista was installed in a primary partition whereas the Win7 was originally in a logical partition.

    Thanks for the COA2 information. So far I have refrained from hacking the systems and use only the OS's own tools or tools from another OS.

    The RHEL is funny because I can boot it up as a single user to the kernel. It just refuses my log in to the desktop. I did come across it with a recent Fedora as older version of Red Hat distros could be moved same as others.
     
  9. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/920542

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice