Gentoo Archives: gentoo-user

From: Daniel Barkalow <barkalow@××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Scary Paritioning - Need Help
Date: Fri, 20 Oct 2006 05:51:42
Message-Id: Pine.LNX.4.64.0610200115070.9789@iabervon.org
In Reply to: [gentoo-user] Scary Paritioning - Need Help by Lord Sauron
1 On Fri, 20 Oct 2006, Lord Sauron wrote:
2
3 > This isn't exactly Gentoo-related, however, you guys tend to be the
4 > most command-line savvy group, and this is all about the command line
5 > at the moment...
6 >
7 > I have three partitions on my workstation's hard drive.
8 >
9 > /dev/sda1 = ntfs (windows)
10 > /dev/sda3 = linux-swap
11 > /dev/sda4 = ext3 (SuSE 10.1)
12 >
13 > Where sda2 should be used to be and XFS partition for Kubuntu.
14 >
15 > My question is thus: how would I tack that free space onto sda4? I
16 > don't want to reinstall SuSE if I don't have to.
17
18 You can't really do this in any straightforward way. The easiest thing is
19 probably to back up the filesystem on sda4 with something like tar, wipe
20 out sda3 and sda4, create a new sda2 (ext3) and sda3 (swap), and untar the
21 backed up filesystem onto sda2.
22
23 The main issue is that ext3 doesn't support resizing. You need to create a
24 new filesystem in order to get a different size. Furthermore, partitions
25 are addressed from the beginning, which means that moving the beginning
26 will completely change everything.
27
28 What I'd do is create a new /dev/sda2 and put home directories there. This
29 has a number of minor benefits (and minor drawbacks), but the main thing
30 is that you'll have more accessible storage for linux without changing
31 your existing filesystem. (And you can move a lot of stuff to the new
32 space, leaving more space free on the existing partition)
33
34 E.g.:
35
36 Back up everything, in case you screw up or my instructions are wrong.
37 Create a new partition 2 on sda with all of the free storage.
38 Mount the existing sda4 on /mnt/sda4
39 mke2fs -j /dev/sda2
40 Mount the new sda2 on /mnt/sda2
41 cp -a /mnt/sda4/home /mnt/sda2
42 mv /mnt/sda4/home /mnt/sda4/home-old
43 mkdir /mnt/sda4/home
44 Edit /mnt/sda4/etc/fstab to add an entry for /dev/sda2 on /home as ext3.
45 Make sure the it all boots correctly, and comes up with your user(s) home
46 directories correctly, and that you have /home listed in the result of
47 "mount".
48 When you're really sure, "rm -rf /home-old" to reclaim the space.
49
50 Drawbacks: /home and / will fill up independantly, so you can run out of
51 space on one when there's still space on the other, and balancing these
52 is a pain.
53 Benefits: if you fill up /home, things that are trying to write to / won't
54 have problems while you clear out more space. Also, if you decide to
55 ditch SuSE in favor of (for example) Gentoo, your home directory is
56 separate from your system files, so most of the stuff you'll want to keep
57 is separate from the stuff you're ditching with SuSE.
58
59 -Daniel
60 *This .sig left intentionally blank*
61 --
62 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] Scary Paritioning - Need Help Dirk Heinrichs <ext-dirk.heinrichs@×××××.com>
Re: [gentoo-user] Scary Paritioning - Need Help Alan McKinnon <alan@××××××××××××××××.za>
[gentoo-user] Re: Scary Paritioning - Need Help Alexander Skwar <listen@×××××××××××××××.name>