Gentoo Archives: gentoo-user

From: Alex Schuster <wonko@×××××××××.org>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] fsck separate /usr
Date: Sun, 13 May 2012 15:13:52
Message-Id: 20120513171155.09993b48@weird.wonkology.org
In Reply to: Re: [gentoo-user] fsck separate /usr by Philip Webb
1 Philip Webb writes:
2
3 > 120513 Alex Schuster wrote:
4 > > I'm using the new udev with a separate /usr partition ...
5 > > after an unclean shutdown
6 > > -- reading files in /proc/<pid>/ was not a good idea --
7 > > /usr wants to be fsck'ed. But it is already mounted at that stage.
8 > > Maybe I should just enlarge my root partition and move /usr there
9 >
10 > Did you see my description of how I did that ? -- see list 120506 .
11 > The actual process took me 2 h 30 m , but preparations spread out
12 > longer. Everything else is working just as before,
13 > but I don't have to bother ever about Initramfs (whatever that is :
14 > smile), & can update Udev without any worries when it becomes stable.
15 > HTH
16
17 I saw that, but here it will be much easier. All is on LVM here, so this should do it:
18
19 # enlarge root partition
20 lvresize -L +17G /dev/weird/root
21 cryptsetup resize root
22 resize2fs /dev/mapper/root
23
24 # make sure /usr is not being written to. For other partitions, I'd
25 # create an LVM snapshot
26 mount -o remount,ro /usr
27
28 # mount root to another place, without mounts like /usr showing up there
29 mkdir /tmp/bindroot
30 mount -o bind / /tmp/bindroot
31
32 # copy data over
33 rsync -ax /usr /tmp/bindroot/
34
35 # remove /usr stuff from fstab and dmcrypt
36 sed "/\/dev\/weird\/usr/ d" /etc/fstab
37 sed -i "/^target=usr2$/{N;N:N:d}" /etc/conf.d/dmcrypt
38
39 # done!
40 reboot
41
42 No need for downtime except for the reboot, I guess I cannot unmount /usr
43 otherwise.
44
45 Wonko

Replies

Subject Author
Re: [gentoo-user] fsck separate /usr Neil Bothwick <neil@××××××××××.uk>