1 (edited by troodon 2007-03-03 03:24:51)

Topic: [solved] Moving Linux (ext3) partition on dual-boot system?

Hi all--

I am new to GParted and I have successfully moved (using the GParted Live CD) a Linux swap partition on a dual boot system. smile

My dual-boot hard drive has three primary partitions: hda1=ntfs; hda2=ext3; and hda3=linux-swap. The boot loader (grub) allows me to choose between XP (first partition, hda1) and Linux (second partition, hda2). There is now some free space between hda2 and hda3. I would like to move the primary Linux partition hda2 "to the right", into the empty space, so that it becomes adjacent to the Linux swap partition (hda3).

Questions: (1) Can GParted successfully move the bootable ext3 partition hda2? (2) Will I be able to boot in Linux after I move that partition (i.e., will the grub boot loader find and boot into the moved partition hda2)?

Thank you for any help you can provide.

2

Re: [solved] Moving Linux (ext3) partition on dual-boot system?

Since you dont create a new partition in the hole, yes grub will surely boot off you linux system. If you create a new partition in the free space, then that depends on how grub is configured.

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)

3

Re: [solved] Moving Linux (ext3) partition on dual-boot system?

Thanks, Larry. Has anyone actually done this? I don't know how grub works and I wonder whether it will try to boot off hda2 (wherever it is located on the hard disk) or it will seek the particular hard disk cylinder where the old hda2 partition start was located.

4

Re: [solved] Moving Linux (ext3) partition on dual-boot system?

Well this is not the goal of *this* forum to give explanations about grub smile
The problem comes from partitions : if grub calls partition like this : /dev/hda2   /   
Or if it calls label ! If it calls label it will work. If not, you will have to edit your grub and/or fstab and make some changes so it can boot.

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)

5

Re: [solved] Moving Linux (ext3) partition on dual-boot system?

LarryT wrote:

Well this is not the goal of *this* forum to give explanations about grub smile

Larry, I agree with you. The problem is, if people try using GParted to move a Linux partition on a multi-boot system and then they cannot boot into Linux anymore, you'll get postings reading that GParted "destroyed" their Linux partition. It may be difficult to fix the bootloader if it cannot find the bootable Linux partition after it has been moved, because one would have to create a custom Linux recovery CD-ROM (floppies are too small for such a task with the latest kernels). I would hate to be the first to try that on a production machine, that's why I am asking if someone has actually used GParted on a dual-boot system. smile

6

Re: [solved] Moving Linux (ext3) partition on dual-boot system?

Listen :
1) i cant guess which distro you use, and there are about 265 distro ATM !!!!
2) i cant know how all the linux distro are working
3) i cant guess if your grub is loading device name or label
4) i cant guess if you change the label of your partition
5) to know how grub works, use "man grub" as i did since years, and like all users do when they want to know something about any of the linux command.
6) to know what happens if you modify one of the partitions of your system you *have to* contact any forum that reports to your distro.

So, i think i am really kind to give help abut something completly different from GParted, because i know many devs who gave up from the beginning.

Any way, if hda2 keeps its position you wont get trouble.
If you want/need more info post here the both output of your grub.conf and fstab.

Be happy, life is funny

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)

7

Re: [solved] Moving Linux (ext3) partition on dual-boot system?

My distribution is CentOS 4.4 (virtually identical to RHEL AS 4.4).

# cat /boot/grub/grub.conf
default=0
timeout=20
splashimage=(hd0,1)/boot/grub/splash.xpm.gz

title CentOS 4.4 (X-Window & KDE)
Red Hat Enterprise Linux AS (2.6.9-42.0.2.plus.c4)
        root (hd0,1)
        kernel /boot/vmlinuz-2.6.9-42.0.3.plus.c4 ro root=LABEL=/ hdc=ide-scsi hdd=ide-scsi quiet rhgb 5
        initrd /boot/initrd-2.6.9-42.0.3.plus.c4.img

title Windows XP
        rootnoverify (hd0,0)
        chainloader +1


# cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda3               swap                    swap    defaults        0 0
/dev/hda1               /mnt/windows          ntfs    ro,umask=0222   0 0
/dev/scd0               /media/cdrecorder0      auto    pamconsole,exec,noauto,managed 0 0


Thanks.

8

Re: [solved] Moving Linux (ext3) partition on dual-boot system?

Okay. CentOS is the *best* distro i've ever seen ! So much stable !
As you can see, your root partition is set as label ! So if you type :

 e2label /dev/hda2

it should return "/" (without the quotes)
So if you move your hda2 partition on the hard drive the system will always be able to find this partition since the label is not overwritten, right ?
But, it is not the same for swap partition. If swap partition is changed (to hda5 e.g.) then you *must* edit fstab and correct the value. It is not a big problem to do that, but you need to boot in single mode or even boot off a livecd that alloaws you to mount your / partition and then edit your etc/fstab.
another possibility is to disable swap (with a # in front of the line) then make your moves and then boot off you centos and edit fstab and remove the #. then swapon /dev/hdX. And all is okay.

So, your first question was :

Questions: (1) Can GParted successfully move the bootable ext3 partition hda2?

yes

(2) Will I be able to boot in Linux after I move that partition (i.e., will the grub boot loader find and boot into the moved partition hda2)?

Yes, if you dont overwrite the label, which GParted doesnt change. So no problem till there !

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)

9

Re: [solved] Moving Linux (ext3) partition on dual-boot system?

Larry, it worked as expected. Thank you!

GParted rules! smile

10

Re: [solved] Moving Linux (ext3) partition on dual-boot system?

nice smile

Larry
GParted-project Admin
Former GParted-LiveCD maintainer (2007)