LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Can I add a Partition to the front of / partition? (https://www.linuxquestions.org/questions/linux-general-1/can-i-add-a-partition-to-the-front-of-partition-431430/)

glennph93 04-03-2006 02:55 PM

Can I add a Partition to the front of / partition?
 
Ok here's what I want to do with my hard drive partitions, if its posiable
First off here's how my drive is set up.

sda1 fat32 3.9gb hidden win
sda2 ntfs 72.33gb main windowsxp
sda3 fat32 60.72gb shared between win ubuntu
sda4 extended linux is in here
sda5 ext3 11.57gb /
sda6 swap 541.22 swap


What I want to do is resize sda3 15gb less and put it into the extended part.
Then make the new free space ext3 sda7(I need this for video
editing, I forgot fat32 has file size limitations)
at the beginng of the extended partition.

I was going to use qtparted on my knopix live cd.

My question is can I do this?
Will it mess up my root partion(I know adding to the front of my root will)?
will grub still see it the same way?

saikee 04-03-2006 03:51 PM

The answer is NO or very involved.

You have already used up the 4 primaries with one concerted into the extended partition. So resizing sda3 can only produce dead space that cannot be linked to or integrated with the end of the extended partition of sda4.

An extended partition must have logical partitions in a continuous chain so that the ith logical partition carries the address for the i+1th logical partition. You can read up extended partition in many well documented literature.

You only chance is to delete the entire extended partition or write it out on another hard drive (say an external hard disk), resize sda3 so that the reclaimed space can be integrated into one unalloacted area. You can then recreate sda5 and sda6 as the original sizes, copy back the partitions and proceed to create your intended sda7.

The alteration will cause a Grub failure because the hard disk location of sda5 would have changed. However replicating the boot loader with command "grub-install" will cure it if you boot up a Live CD and chroot to the Linux in sda5.

jschiwal 04-03-2006 03:53 PM

For grub, if you change your menu.lst file to reflect the changes, and edit /etc/fstab, you should be OK. For Lilo, you would need to rerun /sbin/lilo.

Even if you make a mistake, and grub won't boot, you can use the grub shell and autocompletion to locate and load the kernel and initrd files.

If your tool allows resizing partitions, I think after shrinking /dev/sda3, you will need to resize /dev/sda4 before creating a new partition in the hole.

whansard 04-03-2006 05:15 PM

i second saikee. i could do it by hand in about 20 or 30 minutes, but i have never been able to get someone else through it by hand. partition magic could probably do it, (several hours), but wouldnot handle the boot loader for linux. that's easy enough to do by hand, boot with a rescue disk, chroot into the partition and run lilo or grub, like
# chroot /dev/hda5 lilo

are you using the nt boot loader to get to lilo or what.


a key to making partition moves go well is to have the partition have the exact same number of cylinders, heads and sectors. that way you can restore a full partition with dd.

glennph93 04-08-2006 04:24 PM

Thanks Guys
Sorry it took so long to get back to you, I decided just to convert my sda3 drive to ext3, I figure I'll be needing more space for the linux side anyways. It was easy enough just using the disk manager in ubuntu and adding fstab entry for the newly formatted partition. Although I haven't booted into windows to see if it had a problem with it.


All times are GMT -5. The time now is 10:35 AM.