I have an hard disk image of an openSUSE
installation from a x86-64 machine which I no longer have access to. I'm trying to boot from this raw disk using quemu
. If I start the virtual machine with for example qemu-system-x86_64 -m 4096 -curses -hda srv.sda -enable-kvm
or qemu-system-x86_64 -m 4096 -curses -drive id=disk,file=srv.sda,if=none,format=raw -device ahci,id=ahci -device ide-drive,drive=disk,bus=ahci.0 -enable-kvm
, then I end up in the GRUB 2.02 shell, where I can specify the Linux kernel and initial ramdisk with commands below:
grub> linux (hd0,msdos1)/boot/vmlinuz
grub> initrd (hd0,msdos1)/boot/initrd
grub> boot
This starts the boot process which always ends here:
[ 0.234732] NET: Registered protocol family 10
[ 0.235188] lo: Disabled Privacy Extensions
[ 0.235592] lib80211: common routines for IEEE802.11 drivers
[ 0.236014] registered taskstats version 1
[ 0.236439] Magic number: 1:617:774
[ 0.236774] mem zero: hash matches
[ 0.237151] rtc_cmos 00:01: setting system clock to 2021-04-22 07:46:24 UTC (
1619077584)
[ 0.237802] Freeing unused kernel memory: 896k freed
[ 0.238330] Write protecting the kernel read-only data: 10240k
[ 0.238762] Freeing unused kernel memory: 1616k freed
[ 0.239578] Freeing unused kernel memory: 748k freed
doing fast boot
Creating device nodes with udev
[ 0.255337] udev: starting version 157
mount: devpts already mounted or /dev/pts busy
mount: according to mtab, devpts is already mounted on /dev/pts
Boot logging started on /dev/char/../tty1(/dev/console) at Thu Apr 22 10:46:24 2
021
resume device not found (ignoring)
Waiting for device /dev/sda1 to appear: [ 1.072809] input: ImExPS/2 Generic E
xplorer Mouse as /devices/platform/i8042/serio1/input/input1
..............................Could not find /dev/sda1.
Want me to fall back to /dev/sda1? (Y/n)
Can I modify the disk settings of the qemu
in some way that the first and only partition of the disk becomes available for Linux? For example, looks like GRUB is able to access it as it successfully reads the /boot/vmlinuz
and /boot/initrd
.
EDIT 1: After recreating the initial ramdisk and including the ata_piix
kernel module the qemu-system-x86_64
boot process is following:
[ 0.244118] rtc_cmos 00:01: setting system clock to 2021-04-27 15:31:52 UTC (
1619537512)
[ 0.244762] Freeing unused kernel memory: 896k freed
[ 0.245284] Write protecting the kernel read-only data: 10240k
[ 0.245716] Freeing unused kernel memory: 1616k freed
[ 0.246529] Freeing unused kernel memory: 748k freed
doing fast boot
[ 0.266568] SCSI subsystem initialized
[ 0.267653] megasas: 00.00.04.17.1-rc1 Thu. Oct. 29, 11:41:51 PST 2009
[ 0.278467] scsi0 : ata_piix
[ 0.278833] scsi1 : ata_piix
[ 0.279164] ata1: PATA max MWDMA2 cmd 0x1f0 ctl 0x3f6 bmdma 0xc060 irq 14
[ 0.279562] ata2: PATA max MWDMA2 cmd 0x170 ctl 0x376 bmdma 0xc068 irq 15
Creating device nodes with udev
[ 0.444780] udev: starting version 157
mount: devpts already mounted or /dev/pts busy
mount: according to mtab, devpts is already mounted on /dev/pts
Boot logging started on /dev/char/../tty1(/dev/console) at Tue Apr 27 18:31:52 2
021
resume device not found (ignoring)
Waiting for device /dev/sda1 to appear: [ 1.080811] input: ImExPS/2 Generic E
xplorer Mouse as /devices/platform/i8042/serio1/input/input1
..............................Could not find /dev/sda1.
Want me to fall back to sda1? (Y/n)
As seen above, the ata_piix
module seems to be loaded, but /dev/sda1
is still not found.
EDIT 2: I modified the /etc/fstab
in chroot
environment in a way that /dev/sda1 / reiserfs acl,user_xattr 1 1
was replaced with UUID=dafc3c3a-1469-44b1-b85c-deb904aac291 / reiserfs acl,user_xattr 1 1
, regenerated the initial ramdisk and tried to boot this system by specifying the Linux kernel and initial ramdisk in the GRUB shell:
grub> linux (hd0,msdos1)/boot/vmlinuz root=UUID=dafc3c3a-1469-44b1-b85c-deb904aac291
grub> initrd (hd0,msdos1)/boot/initrd
grub> boot
Unfortunately, the system did not boot. I'll also add the mkinitrd
output:
# mkinitrd -v -k vmlinuz-2.6.34.10-0.6-default -i initrd-2.6.34.10-0.6-default -d /
Kernel image: /boot/vmlinuz-2.6.34.10-0.6-default
Initrd image: /boot/initrd-2.6.34.10-0.6-default
[MODULES] 02-start.sh: reiserfs thermal megaraid_sas ata_piix ata_generic processor fan
[MODULES] 02-start.sh:
[MODULES] 03-rtc.sh: rtc_cmos
[MODULES] 03-storage.sh: reiserfs
[MODULES] 11-usb.sh: usbcore
[MODULES] 11-usb.sh: ohci_hcd
[MODULES] 11-usb.sh: uhci-hcd
[MODULES] 11-usb.sh: ehci_hcd
[MODULES] 11-usb.sh: usbhid
[MODULES] 'modinfo -k "2.6.34.10-0.6-default" -F supported' returned with an error.
Kernel Modules: reiserfs thermal_sys thermal scsi_mod megaraid_sas libata ata_piix ata_generic processor fan usbcore pcmcia_core pcmcia mmc_core ssb ohci-hcd ehci-
hcd uhci-hcd usbhid
[MOUNT] Root: /
Features: usb resume.userspace resume.kernel
Bootsplash: openSUSE (640x480)
Shared libs: /lib/udev/collect_lvm is a script
/lib/udev/findkeyboards is a script
/lib/udev/idedma.sh is a script
/lib/udev/iwlwifi-led.sh is a script
/lib/udev/keyboard-force-release.sh is a script
/lib/udev/kpartx_id is a script
/lib/udev/udev-add-printer is a script
/lib/udev/write_cd_rules is a script
/lib/udev/write_net_rules is a script
/lib/mkinitrd/bin/ipconfig.sh is a script
/sbin/ifup is a script
/lib/mkinitrd/bin/ipconfig.sh is a script
/lib/mkinitrd/bin/linuxrc is a script
/usr/bin/on_ac_power is a script
lib64/ld-2.11.2.so lib64/libacl.so.1.1.0 lib64/libattr.so.1.1.0 lib64/libblkid.so.1.1.0 lib64/libcap.so.2.16 lib64/libcom_err.so.2.1 lib64/libcrypto.so.1.0.0 lib64
/libc-2.11.2.so lib64/libdevmapper.so.1.02 lib64/libdl-2.11.2.so lib64/libgcrypt.so.11.5.2 lib64/libgpg-error.so.0.5.0 lib64/libkeyutils-1.3.so lib64/liblzo2.so.2.
0.0 lib64/libm-2.11.2.so lib64/libncurses.so.5.7 lib64/libpcre.so.0.0.1 lib64/libpthread-2.11.2.so lib64/libreadline.so.6.1 lib64/libresolv-2.11.2.so lib64/librt-2
.11.2.so lib64/libselinux.so.1 lib64/libsepol.so.1 lib64/libssl.so.1.0.0 lib64/libudev.so.0.8.2 lib64/libutil-2.11.2.so lib64/libuuid.so.1.3.0 lib64/libz.so.1.2.3
usr/lib64/libatasmart.so.4.0.3 usr/lib64/libcups.so.2 usr/lib64/libdal-0.3.so.0.0.0 usr/lib64/libdirect-1.2.so.9.0.0 usr/lib64/libdirectfb-1.2.so.9.0.0 usr/lib64/l
ibfusion-1.2.so.9.0.0 usr/lib64/libglib-2.0.so.0.2400.1 usr/lib64/libgssapi_krb5.so.2.2 usr/lib64/libk5crypto.so.3.1 usr/lib64/libkrb5.so.3.3 usr/lib64/libkrb5supp
ort.so.0.1 usr/lib64/libparted.so.0.0.1 usr/lib64/libreiserfs-0.3.so.0.0.0 usr/lib64/libsplashycnf.so.1.0.0 usr/lib64/libsplashy.so.1.0.0 usr/lib64/libusb-0.1.so.4
.4.4 usr/lib64/libusb-1.0.so.0.0.0 lib64/libnss_dns-2.11.2.so lib64/libnss_dns.so.2 lib64/libnss_files-2.11.2.so lib64/libnss_files.so.2 lib64/libgcc_s.so.1
37516 blocks
Perl-Bootloader: 2021-05-03 18:57:38 ERROR: UDEVMAPPING: dmdev /dev/dm-0 doesn't have defined DM_NAME in udev
#
There is an error about the DM_NAME
variable in udev
, but on the other hand, new initial ramdisk file is created and for example, adding the ata_piix
clearly worked. I have also tried with different root devices(-d
option) for mkinitrd
like sda1
.
x86-64 machine
was axen
virtual machine./dev/sda
Perhaps consider replacing/dev/sda1
withUUID=<the uuid of the device>
you'd get the UUID by mounting it and then runningblkid
As you've stated qemu you can probably mount the disk on the hypervisorqemu
command did you use after you addedata_piix
to the initial ramdisk? I would expect that driver to detect yourqemu ... -hda ...
command, but not theqemu ... -device ahci ...
one because the latter requires yet a different driver in the Linux guest/dev/sda1
with theUUID
? @LL3 I used theqemu ... -hda ...
command.