Gentoo Archives: gentoo-user

From: antlists <antlists@××××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] resizing and moving home directory to new partition on save drive
Date: Sun, 10 Jan 2021 22:46:13
Message-Id: 0de4c60d-1889-3bae-eab7-64cd8279952e@youngman.org.uk
In Reply to: [gentoo-user] resizing and moving home directory to new partition on save drive by thelma@sys-concept.com
1 On 10/01/2021 21:42, thelma@×××××××××××.com wrote:
2 > I want to move /home directory to a new partition (save drive).
3 >
4 > I have 1-SSD drive:
5 > Filesystem Size Used Avail Use%
6 > /dev/sda4 916G 405G 464G 47% /
7 >
8 >
9 > Home directory is on it taking about 360GB
10 >
11 > I was planning doing it in stages.
12 >
13 > Stage-1
14 > Using Gparted to resize "/" portion shirk it to about 450GB
15 > create new ext4 partition for /home /dev/sda5
16 >
17 > Boot-strap the PC with live-gentoo
18 > mv /home /home.org
19 > mkdir /home
20 > mount ext4 /dev/sda5 /home/
21 >
22 > cp -rp /home.org/* /home/
23 >
24 > edit fstab:
25 > /dev/sda5 /home ext4 default 0 0
26 > reboot and test home
27 >
28 > Am I missing something?
29
30 Couple of things.
31
32 Firstly, why use a gentoo live disk? Just log in as root.
33
34 Secondly, why rename home? Just mount sda5 on /mnt to do the move, then
35 add it to fstab to mount on /home.
36
37 And a little bit you might have missed - DON'T put root's home on a
38 mounted disk - if it's currently in /home, move it to /. Don't forget to
39 edit /etc/passwd if you have to move it.
40
41 > If everything works, remove /home.org
42 >
43 > Stage-2:
44 > With Gparted resize both root and home portion, giving root about 200GB and rest to /home (dev/sda5)
45 >
46 The other way to do it is if you've got a spare hard drive lying around.
47 Just copy /home onto it (bearing in mind my comment about root's home),
48 and then copy it back.
49
50 But what do you mean by "save drive"? Just splitting the drive into 2
51 partitions won't do anything, will it? If you want to "save the drive" I
52 think you need to move /home to spinning rust :-) Unless you're
53 physically updating the hardware, I wouldn't bother.
54 >
55 Cheers,
56 Wol

Replies