On Fri, 20 Oct 2006, Lord Sauron wrote:

> This isn't exactly Gentoo-related, however, you guys tend to be the
> most command-line savvy group, and this is all about the command line
> at the moment...
> 
> I have three partitions on my workstation's hard drive.
> 
> /dev/sda1 = ntfs (windows)
> /dev/sda3 = linux-swap
> /dev/sda4 = ext3 (SuSE 10.1)
> 
> Where sda2 should be used to be and XFS partition for Kubuntu.
> 
> My question is thus: how would I tack that free space onto sda4?  I
> don't want to reinstall SuSE if I don't have to.

You can't really do this in any straightforward way. The easiest thing is 
probably to back up the filesystem on sda4 with something like tar, wipe 
out sda3 and sda4, create a new sda2 (ext3) and sda3 (swap), and untar the 
backed up filesystem onto sda2.

The main issue is that ext3 doesn't support resizing. You need to create a 
new filesystem in order to get a different size. Furthermore, partitions 
are addressed from the beginning, which means that moving the beginning 
will completely change everything.

What I'd do is create a new /dev/sda2 and put home directories there. This 
has a number of minor benefits (and minor drawbacks), but the main thing 
is that you'll have more accessible storage for linux without changing 
your existing filesystem. (And you can move a lot of stuff to the new 
space, leaving more space free on the existing partition)

E.g.:

 Back up everything, in case you screw up or my instructions are wrong.
 Create a new partition 2 on sda with all of the free storage.
 Mount the existing sda4 on /mnt/sda4
 mke2fs -j /dev/sda2
 Mount the new sda2 on /mnt/sda2
 cp -a /mnt/sda4/home /mnt/sda2
 mv /mnt/sda4/home /mnt/sda4/home-old
 mkdir /mnt/sda4/home
 Edit /mnt/sda4/etc/fstab to add an entry for /dev/sda2 on /home as ext3.
 Make sure the it all boots correctly, and comes up with your user(s) home 
  directories correctly, and that you have /home listed in the result of 
  "mount".
 When you're really sure, "rm -rf /home-old" to reclaim the space.

Drawbacks: /home and / will fill up independantly, so you can run out of 
 space on one when there's still space on the other, and balancing these 
 is a pain.
Benefits: if you fill up /home, things that are trying to write to / won't 
 have problems while you clear out more space. Also, if you decide to 
 ditch SuSE in favor of (for example) Gentoo, your home directory is 
 separate from your system files, so most of the stuff you'll want to keep 
 is separate from the stuff you're ditching with SuSE.

        -Daniel
*This .sig left intentionally blank*
-- 
gentoo-user@gentoo.org mailing list

Reply via email to