Gentoo Archives: gentoo-user

From: Michael Mol <mikemol@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] /home on other partion move
Date: Mon, 16 Jul 2012 15:55:34
Message-Id: CA+czFiD9X9jBH_0PqQPFu1sxQabtut5yMWdkzks4NMb+Cuxp5g@mail.gmail.com
In Reply to: [gentoo-user] /home on other partion move by Silvio Siefke
1 On Mon, Jul 16, 2012 at 11:34 AM, Silvio Siefke <siefke_listen@×××.de> wrote:
2 > Hello,
3 >
4 > my hdd is full and on the free partion i want make the /home partion.
5 > But how can make it? Copy and fstab? When i mount the partion over thunar
6 > i can not write as user on the partion.
7 >
8 > /dev/sda3 on /run/media/siefke/data type ext4 (rw,nosuid,nodev,uhelper=udisks2)
9 >
10 > Has someone a advice for me? Thank you.
11
12 Here's how I'd do it. Take a backup first! At least a couple of these
13 commands could result in massive data loss if you have a typo. It's
14 also pretty important that you be logged in as root, and that no user
15 whose home directory is under /home is currently logged in.
16
17 # Create your target filesystem
18 mkfs.ext4 $your_new_partition
19
20 # Mount your target filesystem
21 mount -t auto $your_new_partition /mnt/
22
23 # Copy your data to your target filesystem.
24 cp -a /home/* /mnt/
25
26 Verify that the data that was in /home now exists in /mnt
27
28 # Remove the data from /home/, as it will otherwise continue taking up
29 space on your hard disk.
30 rm -rf /home/*
31
32 # Unmount your target filesystem,
33 umount /mnt/
34
35 Modify /etc/fstab to mount $your_new_partition at /home
36
37 # Mount your new /home
38 mount /home
39
40 --
41 :wq