:: Re: [DNG] Trouble getting copied sy…
Top Pagina
Delete this message
Reply to this message
Auteur: Didier Kryn
Datum:  
Aan: dng
Onderwerp: Re: [DNG] Trouble getting copied system to boot
Le 18/12/2017 à 02:29, Hendrik Boom a écrit :
> On Sun, Dec 17, 2017 at 11:36:19PM +0100, Didier Kryn wrote:
>> Le 17/12/2017 à 19:13, Hendrik Boom a écrit :
>>> On Sun, Dec 17, 2017 at 02:03:52PM +0100, Florian Zieboll wrote:
>>>> On Sat, 16 Dec 2017 21:42:05 -0500
>>>> Hendrik Boom <hendrik@???> wrote:
>>>>
>>>>> How do I update the initrd?
>>>> To update the /initrd/initramfs/ of a not-booting system, I chroot into
>>>> it, (mount the /boot partition) and "bind mount" /dev. Then
>>>>
>>>> $ update-initramfs -u
>>>>
>>>> and
>>>>
>>>> $ update-grub
>>> First time I've done something like that in chroot.
>>> It would be something like
>>>
>>> mkdir /ascii/dev
>>> mount --bind /dev /ascii/dev
>>> chroot /ascii
>>> update-initramfs -u
>>> update-grub
>>>
>>> ?
>>>
>>     /ascii/dev should exist already. You just need to mount it.
> It doesn't.
>
>>     I suggest also the following:
>>     mount -t proc none /ascii/proc
>>     mount -t sysfs none /ascii/sys
>>
>>     This raises the question: "how did you clone your OS?" Because, if you
>> copied it while /dev, /sys, /proc, and /run where mounted, then you have
>> stored a lot of things that shouldn't be there. Better check and empty those
>> directories on /ascii.
> I copied them with rsync, using the option that copies one file system
> only; i.e. does not cross file system boundaries. That's why there
> is no /ascii/dev -- the original /dev was a mounted file system
> created by I presume udev.

    But you need the mountpoints for /dev, /proc, /sys, that is empty
directories. Look at what you have in / and check you have all the same
directories in /ascii (not /ascii/ascii, of course). The OS is spread in
/bin, /boot, /lib, /lib32, /lib64, /etc, /opt, /root, /sbin, /srv, /usr,
/var. Some can be empty (/root, /opt, /srv); apt-get dist-upgrade will
modify the contents of all these directories. They should, of course not
be shared between your two OSes.

    You can use rsync as you did, for all the directories other than
proc, sys, run and dev, after all those which are mountpoints have been
mounted. Then mount /ascii/{proc, sys, dev} as said above, and then chroot.
And, before booting your new OS, check carefully the fstab.
>
> Which is why I thought I had to create the mount point in ascii.
> Now I suspect I'd also have to create /sys /proc and /run as
> additional mount points?
>
> Or should I start over, booting refracta instead of my new system and
> using refracta to copy everything when everything isn't the working
> system?


    Cloning a running OS is non-trivial. It is easier to clone it when
it is not running, for example, plugging the disk in another machine
running its own OS, or using a third OS on the same machine, as I
understand you propose.ALso, beware that the two OSes should not be
mixed. At the maximum, they can share /home, and, even for /home it is
dangerous: the applications on the newer OS will update users' config
filesthe first time they are used (eg firefox or thunderbird) and make
them unusable in the older OS.

    For what concerns grub, as far as I understand, you should not need
to chroot to run update-grub. update-grub is supposed to detect all OSes
present on the machine and create a boot menu. Better run it on your
main OS.

        Didier