Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Moving and resizing partitions (including reiserfs)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
lunarg
Guru
Guru


Joined: 07 Jan 2004
Posts: 508
Location: Peer, Belgium

PostPosted: Mon Mar 15, 2004 5:25 pm    Post subject: [SOLVED] Moving and resizing partitions (including reiserfs) Reply with quote

Hi all.

Today I've made a wise decision :wink: and decided to erase WinXP from my HD, and merging the free space with my / partition. However, after a brief search on this forum, my eager enthousiasm disappeared a bit: I'm using reiserfs 3.6 for my root partition, and it's not as simple as "just" moving and resizing the partitions :? .

Here's my partition layout:
Code:
Disk /dev/hda: 30.0 GB, 30005821440 bytes
255 heads, 63 sectors/track, 3648 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/hda1   *           1         811     6514326    7  HPFS/NTFS
/dev/hda2             812         816       40162+  83  Linux
/dev/hda3             817         879      506047+  82  Linux swap
/dev/hda4             880        3648    22241992+  83  Linux

Also:
Quote:
/dev/hda2 is my /boot and is ext2
/dev/hda3 is my swap space
/dev/hda4 is my root (/) and is reiserfs 3.6

What I want to do is to remove /dev/hda1 and move all partitions up the line, so /dev/hda2 becomes /dev/hda1, etc. Then, I want to resize my root partition (which will then be /dev/hda3).

I was hoping to get some suggestions on this matter on how to deal with it without having to reinstall Gentoo (which would be A LOT of work). Of course, it goes without saying that I'll be making a complete backup with Ghost before I do anything.

Maybe a thought: I could copy my entire / to another pc, do the moving/resizing, then do mkreiserfs (with the LiveCD), and then copy the entire tree back to the partition.... This might just work, but because of the large data and limited LAN bandwidth, only a last resort.
_________________
Registered linux user #341804
Visit Black Manticore: http://www.blackmanticore.com/


Last edited by lunarg on Tue Mar 16, 2004 3:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
bombcar
Guru
Guru


Joined: 08 Apr 2003
Posts: 453
Location: Wisconsin

PostPosted: Mon Mar 15, 2004 6:14 pm    Post subject: Reply with quote

You're in a hard state! You want to merge free space at the beginning of the drive with a filesystem at the end of the drive! Ouch.

Your best bet, in my opinion, is to use the other drive to copy to. Or get something like Partition Magic, but it would probably eat your files anyway.

If you really want to do it, here's some steps that MIGHT work......

1. Delete /dev/hda1
2. Create a /dev/hda1 the same size as /dev/hda2 (boot)
3. format /dev/hda1 the same way you did /dev/hda2, and then copy everything over (look for the Large Disk HOWTO and there is a tar command that does what you want, I believe, or use cp -a)
4. Verify that you can boot off of /dev/hda1 after updating everything.
5. Delete /dev/hda2 and /dev/hda3 (do a swapoff /dev/hda3 first).
6. Create /dev/hda2 as your swap partiton, mkswap /dev/hda2, swapon /dev/hda2, edit fstab to show changes.
7. Boot again, to verify this.
8. Now your free space is right next to the reiserfs free space, so you can begin investigating how to expand the partition. If the partition has to grow at the end, you may still have problems.

Argh! I'd just use the second disk, and copy everything over after booting from a livecd.

:)
Back to top
View user's profile Send private message
lunarg
Guru
Guru


Joined: 07 Jan 2004
Posts: 508
Location: Peer, Belgium

PostPosted: Mon Mar 15, 2004 10:23 pm    Post subject: Reply with quote

I thought so, so I started with tarring my / to another disk, then alter the partitions, then copy it back.
I think it's the safest method; maybe not the fastest, but I'd rather do this than reinstalling my entire system.

Still thanks a bunch for the help.
_________________
Registered linux user #341804
Visit Black Manticore: http://www.blackmanticore.com/
Back to top
View user's profile Send private message
lunarg
Guru
Guru


Joined: 07 Jan 2004
Posts: 508
Location: Peer, Belgium

PostPosted: Mon Mar 15, 2004 10:24 pm    Post subject: Reply with quote

Still one question, though.

Since the partitions all move up the line, I know that I need to update my lilo.conf and /etc/fstab.
Is there anything else that I need to change?
_________________
Registered linux user #341804
Visit Black Manticore: http://www.blackmanticore.com/
Back to top
View user's profile Send private message
bombcar
Guru
Guru


Joined: 08 Apr 2003
Posts: 453
Location: Wisconsin

PostPosted: Mon Mar 15, 2004 11:10 pm    Post subject: Reply with quote

lilo.conf will change, /etc/fstab will change, but nothing else should change.

But, keep the liveCD handy in case something breaks!

I've done this before, so it should work!

:)
Back to top
View user's profile Send private message
lunarg
Guru
Guru


Joined: 07 Jan 2004
Posts: 508
Location: Peer, Belgium

PostPosted: Tue Mar 16, 2004 3:42 pm    Post subject: Reply with quote

Okay :D

I've managed to copy the data to another computer, changed the partitions, and copied it back, and my system seems to be working just fine again, and with 6gb more for my linux system.

Thanks for the help.
_________________
Registered linux user #341804
Visit Black Manticore: http://www.blackmanticore.com/
Back to top
View user's profile Send private message
bombcar
Guru
Guru


Joined: 08 Apr 2003
Posts: 453
Location: Wisconsin

PostPosted: Tue Mar 16, 2004 4:29 pm    Post subject: Reply with quote

cool! :D
Back to top
View user's profile Send private message
pjp
Administrator
Administrator


Joined: 16 Apr 2002
Posts: 20485

PostPosted: Wed Aug 04, 2004 11:32 pm    Post subject: Reply with quote

https://forums.gentoo.org/viewtopic.php?t=75699
_________________
Quis separabit? Quo animo?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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