All the following edited for brevity/clarity. The basic concept should match the slightly more complicated reality.
I currently have a system with a single 500 MB drive which has small 32-bit openSUSE 13.2 and swap partitions, and a large user data partition. I want to install a second, small drive with 13.2+swap and reformat the entire large drive for data. I wanted to try copying the 13.2 partition rather than doing a full reinstall, partly as a learning exercise. Because the old and new 13.2 partitions’ sizes are different this would not be a block-by-block, dd[FONT=arial], copy.
I attached the new drive with an IDE/PATA-to-USB adapter, created a linux and a swap partition with [FONT=courier new]fdisk[FONT=arial] (leaving 1MB for an MBR and bootloader at the beginning of the drive), and formatted them with mkfs.ext4[/FONT] and **mkswap ** respectively. I then copied the running 13.2 system from the old drive to the new with:
rsync --verbose \
--archive \
--xattrs \
--acls \
--hard-links \
--sparse \
--one-file-system \
--numeric-ids \
--exclude=lost+found \
--exclude=proc/\* \
--exclude=sys/\* \
--exclude=mnt/\* \
--exclude=media/\* \
--exclude=dev/pts\* \
--exclude=tmp/\* \
/{*,.*} \
/mnt/sdb1
Then:
- Edited **/mnt/sdb1/{etc/fstab,boot/grub2/grub.cfg} **
and changed all UUIDs from the old disk’s to the new one’s (and changed a menuentry string to confirm that the new grub.cfg was being used at boot time). - Ran grub2-install --boot-directory=/mnt/sdb1/boot /dev/sdb - Checked and saw that **sdb **
[FONT=arial]had bootloader code following the MBR which also had the 13.2 partition’s boot flag set[/FONT]
[FONT=arial]With the BIOS set to the USB drive, the copied system is definitely trying to boot – the modified GRUB menu entry shows up. I get “loading system” and “loading initial ramdisk” and a brief flash of the green “splat” (Plymouth?) screen.
But it immediately returns to a text virtual terminal with:
OK ] Reached target System Initialization.
OK ] Started Show Plymouth Boot Screen.
OK ] Reached target Paths.
OK ] Reached target Basic System.
[/FONT][/FONT][/FONT]and hangs there for 5 minutes before dumping into a “dracut” rescue shell.
The critical line in dracut’s /run/initramfs/rdsosreport.txt seems to be:
313.618838] ffcat dracut-initqueue[191]: Warning: /dev/disk/by-uuid/049cad3c-0724-4a10-a5ad-1ee7eef88157 does not exist
That’s the correct UUID of the new disk’s root partition. But checking /dev/disk/by-uuid in the running dracut shell shows only the UUIDs of the old disk. It’s also clear from earlier in *rdsosreport.txt [FONT=arial]that only the old disk is being detected and having [FONT=courier new]/dev/sd **[FONT=arial]entries created – nothing for the new disk
Three possible problems (probably more):
- There’s a fatal flaw in my methodology. (I was afraid of the [FONT=courier new]rsync
[FONT=arial] copy from a running system, but the boot is failing long before that.)[/FONT] 1. [FONT=arial]The old UUIDs are baked into [FONT=courier new]/boot/initrd*
[FONT=arial] (which was copied unchanged from the old disk) and GRUB isn’t or can’t pass new parameters to it.[/FONT][/FONT][/FONT] 1. [FONT=arial][FONT=courier new][FONT=arial]Some combination of [/FONT][/FONT][/FONT][FONT=arial][FONT=courier new][FONT=arial][FONT=courier new][FONT=arial][FONT=courier new]initrd
[FONT=arial] and/or this BIOS can’t scan a USB-attached drive (works fine with an already running system).[/FONT][/FONT][/FONT][/FONT][/FONT][/FONT][/FONT]
[FONT=arial][FONT=courier new][FONT=arial][FONT=courier new][FONT=arial][FONT=courier new][FONT=arial]Any suggestions, particularly critiques of #1, welcome.
[/FONT][/FONT][/FONT][/FONT][/FONT][/FONT][/FONT]
[/FONT][/FONT][/FONT][/FONT]