Gentoo Archives: gentoo-user

From: "Canek Peláez Valdés" <caneko@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Merging separate /usr back into / - one last time...
Date: Tue, 03 Dec 2013 22:45:24
Message-Id: CADPrc82BChNE_Csfcw+vgHPVDrtCSN7Y5ZNew=Vz8kL+HX=Rdw@mail.gmail.com
In Reply to: Re: [gentoo-user] Merging separate /usr back into / - one last time... by "Canek Peláez Valdés"
1 On Tue, Dec 3, 2013 at 12:06 AM, Canek Peláez Valdés <caneko@×××××.com> wrote:
2 > On Mon, Dec 2, 2013 at 10:34 PM, Jc García <jyo.garcia@×××××.com> wrote:
3 >> 2013/12/2 William Kenworthy <billk@×××××××××.au>
4 >>>
5 >>> You are looking far too deep ....
6 >>>
7 >>>
8 >>> just rsync -avP to /newusr
9 >>
10 >> +1
11 >> I have done this more or less the same way
12 >>>
13 >>> reboot to livecd
14 >>>
15 >>> rsync again with --delete to update ... takes a only few seconds this
16 >>> time - minimal downtime :)
17 >>> mv /usr /oldusr
18 >>> mv /newusr /usr
19 >>> reboot
20 >>
21 >>
22 >> Let's make this thread more interesting, would it be possible to do
23 >> this without a reboot? ie: going single user mode, kill anything that
24 >> might still be running from usr, umount /usr, mount it to /mnt, rsync
25 >> -avP to usr, going again into runlevel 3 or 5.
26 >> Obviously not possible if running systemd.
27 >
28 > I'm not so sure it's not possible. Perhaps it's even easier.
29
30 So, yeah, I think it's easier with systemd. You just:
31
32 1. systemctl isolate emergency.target
33 2. log in again (all the normal gettys are killed with the above command)
34 3. rsync -PvasHA /usr/ /newusr/
35 4. mv /usr /oldusr # mv is on /bin, so no problems here
36 5. mv /newusr /usr
37 6. rm -rf /oldusr (to make sure nothing uses it anymore)
38 7. systemctl isolate multi-user.target
39 8. You have your system again.
40
41 I did this on a minimal QEMU virtual machine. However I think it
42 should work with even the most complex setups, as long as your
43 initramfs has the necessary tools, which is really easy with dracut.
44
45 Regards.
46 --
47 Canek Peláez Valdés
48 Posgrado en Ciencia e Ingeniería de la Computación
49 Universidad Nacional Autónoma de México

Replies

Subject Author
Re: [gentoo-user] Merging separate /usr back into / - one last time... "Jc García" <jyo.garcia@×××××.com>