On Tue, Dec 3, 2013 at 5:22 PM, Jc García <jyo.gar...@gmail.com> wrote:
> 2013/12/3 Canek Peláez Valdés <can...@gmail.com>:
>> On Tue, Dec 3, 2013 at 12:06 AM, Canek Peláez Valdés <can...@gmail.com> 
>> wrote:
>>> On Mon, Dec 2, 2013 at 10:34 PM, Jc García <jyo.gar...@gmail.com> wrote:
>>>> 2013/12/2 William Kenworthy <bi...@iinet.net.au>
>>>>>
>>>>> You are looking far too deep ....
>>>>>
>>>>>
>>>>> just rsync -avP to /newusr
>>>>
>>>> +1
>>>> I have done this more or less the same way
>>>>>
>>>>> reboot to livecd
>>>>>
>>>>> rsync again with --delete to update ... takes a only few seconds this
>>>>> time - minimal downtime :)
>>>>> mv /usr /oldusr
>>>>> mv /newusr /usr
>>>>> reboot
>>>>
>>>>
>>>> Let's make this thread more interesting, would it be possible to do
>>>> this without a reboot? ie: going single user mode, kill anything that
>>>> might still be running from usr,  umount /usr, mount it to /mnt, rsync
>>>> -avP to usr, going again into runlevel 3 or 5.
>>>> Obviously not possible if running systemd.
>>>
>>> I'm not so sure it's not possible. Perhaps it's even easier.
>>
>> So, yeah, I think it's easier with systemd. You just:
>>
>> 1. systemctl isolate emergency.target
>> 2. log in again (all the normal gettys are killed with the above command)
>> 3. rsync -PvasHA /usr/ /newusr/
>> 4. mv /usr /oldusr # mv is on /bin, so no problems here
>> 5. mv /newusr /usr
>> 6. rm -rf /oldusr (to make sure nothing uses it anymore)
>> 7. systemctl isolate multi-user.target
>> 8. You have your system again.
>>
> Nice, I thought systemd residing within /usr would be the limitation,
> i haven't used systemd very much , so i don't really know it's options,
> but later after thinking about it, i thought that using the initramfs
> would be a way to go,
> but as i understand here systemd already has an option to make use of it.

Yeah, you can create an initramfs with dracut that uses systemd; the
initramfs mounts /usr, and then handles back control to the systemd
instance in it. When shutting down, the inverse occurs; the systemd in
/usr handles back control to the systemd in the initramfs, which in
turns shutdowns the machine.

I don't know exactly how problematic would be for a complex setup
(/usr using LVM+cryptfs+mdraid, for example), but if the necessary
tools are available in the initramfs, then I think  it could be done.

Of course, the simplest and easiest thing to do is to use a live CD.

Regards.
-- 
Canek Peláez Valdés
Posgrado en Ciencia e Ingeniería de la Computación
Universidad Nacional Autónoma de México

Reply via email to