Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Resizing partitions on dual boot system
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Sat Jun 14, 2003 3:07 pm    Post subject: Resizing partitions on dual boot system Reply with quote

My laptop is setup to dual boot Win 98 and Gentoo. My Win 98 partition takes the majority of the disk, but as I prettty much use Gentoo exclusively now, I would like to resize my partitions.

Here's my current setup:

Code:

/dev/hda1   Win95 FAT32 (LBA)  (about 18GB)
/dev/hda2   Extended
/dev/hda5   /boot              (about 100 MB)
/dev/hda6   /                  (about 5 GB)
/dev/hda7   swap               (256 MB)
/dev/hda8   /home              (about 5 GB)

My / and /home partitions are reiserfs.

What I would like is:
Code:

Win98 ~5 GB
/boot -- same
/     -- same
swap  -- same
/home -- ~15 GB

What would be the best way to go about doing this? PartitionMagic won't work since it won't deal with reiserfs. Parted looks like it will be very difficult since I have to move the beginning of all my partitions.
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Sat Jun 14, 2003 3:45 pm    Post subject: Reply with quote

Actually parted would not be all that difficult in your situation, since you're taking such a large chunk from your windows partition relative to the current size of your linux partitions. Parted can move partitions as long as the new location doesn't overlap the old. Just resize the windows and extended partitions. Then move all your linux partitions back, then resize home. Reinstall the bootloader and that should be all there is to it.
Back to top
View user's profile Send private message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Sun Jun 15, 2003 3:40 am    Post subject: Reply with quote

Well, I was able to get part of the way there. I shrunk the Win98 partition, and reset the start of the extended partition without problems. I then went to move my /boot partition (/dev/hda5, ext3). I got the "Filesystem has incompatible feature enabled". I searched the gentoo forums and found the fix using tune2fs to remove the dir_index flag and then ran e2fsck. Now when I try to move the /boot partition, I am getting a "This ext2 filesystem has a rather strange layout" error, and I can't move the partition.

I also removed the has_journal flag and reset the entry for /boot in my fstab to ext2, without any luck.

Any suggestions would be appreciated.
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Sun Jun 15, 2003 3:25 pm    Post subject: Reply with quote

If you're getting the "strange layout" error then e2fsck did not remove the htree indexes. Make sure you're using the e2fsck from e2fsprogs 1.29 or greater but not 1.30-WIP. You can check the version by running mke2fs with no options. Make sure you give it the -f option. It should ask you about removing "htree" something or other a few times, be sure to say yes to each one. If that goes correctly then parted should be able to move it. No need to remove the has_journal flag.
Back to top
View user's profile Send private message
wilburpan
l33t
l33t


Joined: 21 Jan 2003
Posts: 977

PostPosted: Sun Jun 15, 2003 7:06 pm    Post subject: Reply with quote

I actually did see the issue about trying this with an older version of e2fsprogs while searching the forums. I have the latest version of e2fsprogs, and reemerged it just to make sure, but I still was unable to move my /boot partition. This is what I wound up doing:

1. At this point, my 30 GB hard drive file system looked like:
Code:

/dev/hda1 Win98 ~8 GB
/dev/hda2 Extended partition
/dev/hda5 /boot, ext3, starts about 20 GB into my disk
/dev/hda6 /, reiserfs
/dev/hda7 swap, 256MB
/dev/hda8 /home, reiserfs

So there is a big gap of unused disk space between the end of the Win98 partition and my Gentoo partitions.

2. I rebooted using the Gentoo LiveCD. I had 1.4_rc3 handy, so that's what I used. I mounted /dev/hda5 and /dev/hda8 to mnt/boot and /mnt/home. I created a new directory named oldboot within /mnt/home, and copied /boot to it with:
Code:
cp -ax /mnt/boot /mnt/home/oldboot


3. I then unmounted /dev/hda5 and /dev/hda8. I used fdisk (still using the Gentoo LiveCD) to delete /dev/hda5 and recreate it in the location that I wanted. Because of how fdisk numbers new partitions, my new partition set up had the partition numbers out of order. (Specifically, the new partition was now number 8.) There is an option under fdisk that renumbers the partitions in the order that they appear under expert commands. I used this, and now my partitions are numbered in order. I remounted /dev/hda5 and /dev/hda8 as /mnt/boot and /mnt/home, and copied the contents of /mnt/home/oldboot back into the /boot partition. Then I unmounted everything again.

So now the /boot partition is adjacent to the Win98 partition, and the big gap is now between the /boot and / partitions.

4. I was then able to use parted to move my / partition back using the move command.

5. Then I moved swap, and then resized it to 512 MB, just for kicks.

6. Then I moved my /home partition, and then used resize to grow it to fill up the rest of the harddrive.

Now, I have a ~8 GB Windows partition, a 5 GB / partition, a 512 MB swap partition, and a ~18 GB /home partition.

7. I rebooted and held my breath. Everything went well, but I noticed that the boot process wound up running reiserfsck on my / partition, and fixed some errors that I didn't catch. Once I was logged in, I ran reiserfsck on my /home partition, which fixed similar errors. If I had to do this again, I would run the respective *fsck program on all partitions that get moved with parted.

I still don't know why parted wouldn't move my /boot partition, but all is well now.
Back to top
View user's profile Send private message
PowerFactor
Veteran
Veteran


Joined: 30 Jan 2003
Posts: 1693
Location: out of it

PostPosted: Mon Jun 16, 2003 12:00 am    Post subject: Reply with quote

Glad to hear you got it working. It is strange that parted still wouldn't work with your ext3 partition. Removing dir_index and running fsck has always worked for me. Oh well, I hope this ext3 htree stuff is worth the trouble it has been causing once the bugs get worked out and tools get updated to handle it. :roll:
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum