Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cloning system - boot fails [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
binro
l33t
l33t


Joined: 06 May 2005
Posts: 684
Location: Bangkok, Thailand

PostPosted: Fri Jun 04, 2021 5:39 pm    Post subject: Cloning system - boot fails [SOLVED] Reply with quote

I am cloning an existing Gentoo system onto a new machine. I have done this innumerable times and normally it "Just works" but this time something has gone wrong. I always use LVM on my systems, so I booted the new machine with the SysResCD and created the LVs. Then I made an NFS mount to the old machine and copied the volumes across. I updated /etc/fstab, ran grub2-mkconfig and rebooted. I get the Grub menu and selected a kernel and after the "loading initial ramdisk..." message I get a message to the effect of "unable to find block device on /dev/vg00/rootfs" and Grub drops to a shell. The relevant lines from /boot/grub/grub.cfg are:

Code:

linux /vmlinuz-5.12.2-gentoo root=UUID=d2f0ddaa-8103-41a2-a0bc-004c1e523323 ro real_root=/dev/vg00/rootfs init=/linuxrc dolvm quiet CONSOLE=/dev/tty1 vga=0x0361
initrd /initrd-5.12.2-gentoo

Apart from the UUID this is identical to the original machine's. The LVs are:
Code:

# lvs
  LV      VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  home    vg00 -wi-a----- 100.00g                                                   
  portage vg00 -wi-a-----  10.00g                                                   
  rootfs  vg00 -wi-ao----  50.00g                                                   
  tmp     vg00 -wi-a-----   1.00g                                                   
  var     vg00 -wi-a-----  50.00g 

Could it be LVM is not getting activated? When I mount the rootfs LV from the rescue system it is perfectly healthy. The new disk has a GPT label unlike the old one but since the boot partition has been found I assume this is not making any difference. Here are the partitions:
Code:

[root@sysresccd ~]# fdisk -l /dev/nvme0n1
Disk /dev/nvme0n1: 476.96 GiB, 512110190592 bytes, 1000215216 sectors
Disk model: ShiJi 512GB M.2-NVMe                   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 609963E7-9FFB-48C1-A853-58FA762FC2DE

Device            Start       End   Sectors   Size Type
/dev/nvme0n1p1     2048    206847    204800   100M EFI System
/dev/nvme0n1p2   206848    411647    204800   100M BIOS boot
/dev/nvme0n1p3   411648  17188863  16777216     8G Linux swap
/dev/nvme0n1p4 17188864 999804927 982616064 468.6G Linux LVM

Any ideas what I have missed?

Thanks
Robin
_________________
"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling


Last edited by binro on Thu Jun 10, 2021 6:02 pm; edited 1 time in total
Back to top
View user's profile Send private message
alamahant
Veteran
Veteran


Joined: 23 Mar 2019
Posts: 1539

PostPosted: Fri Jun 04, 2021 6:55 pm    Post subject: Reply with quote

Code:

root=UUID=d2f0ddaa-8103-41a2-a0bc-004c1e523323

is this a luks device?
if not you only need
Code:

root=/dev/mapper/<root-lv> rootfstype=<>

the real_root is only used with luks
Also over NFS?
I worry about permissions....
Rsync or a tarball would be much better.....
_________________
:)
Back to top
View user's profile Send private message
binro
l33t
l33t


Joined: 06 May 2005
Posts: 684
Location: Bangkok, Thailand

PostPosted: Fri Jun 04, 2021 7:20 pm    Post subject: Reply with quote

I have been using real_root for years without problems so I don't think it's that. But the NFS permissions could be an issue. Normally I restore from a dar archive but the latest SysResCD systems no longer support it because they are now Arch-based. Perhaps I should use a different rescue system.

Thanks.
_________________
"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling
Back to top
View user's profile Send private message
alamahant
Veteran
Veteran


Joined: 23 Mar 2019
Posts: 1539

PostPosted: Fri Jun 04, 2021 8:11 pm    Post subject: Reply with quote

Ah
you have to rebuild the initramfs.
if not it still cobtains fs data from your old install.
_________________
:)
Back to top
View user's profile Send private message
binro
l33t
l33t


Joined: 06 May 2005
Posts: 684
Location: Bangkok, Thailand

PostPosted: Fri Jun 04, 2021 8:39 pm    Post subject: Reply with quote

alamahant wrote:
Ah
you have to rebuild the initramfs.
if not it still cobtains fs data from your old install.

I am not sure about that, I replaced a disk quite recently and just restored from an archive. I will try it since it's quick but I think doing the copy again using rsync is a better idea.
_________________
"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling
Back to top
View user's profile Send private message
binro
l33t
l33t


Joined: 06 May 2005
Posts: 684
Location: Bangkok, Thailand

PostPosted: Thu Jun 10, 2021 6:02 pm    Post subject: Reply with quote

I reformatted the partitions and copied the old file-system onto them using "rsync -avz ...". I then built a new kernel and ramdisk but got exactly the same error when I attempted to boot the new system. So I then dropped into the ramdisk's shell and poked around. What became obvious was that my SSD hard-drive was not in /dev; with the SysResCD it appears as /dev/nvme0n. So a quick bit of research revealed my kernel had no support for NVMe devices generated. Fixing that and a couple of other modules that seemed to be missing (thanks "lspci -n" and the LKDDb!) and then the new system leapt into life. :D

Thanks
Robin
_________________
"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum