I recently installed a SSD on an old laptop and I kept the previous disk. Now I want to see if I left anything important there, so I put it into a USB to SATA cask and I'm trying to access my data. The OS there is a Debian installation with encrypted home directory using ecryptfs. I tried mounting my Private directory in my current laptop (also Debian) but couldn't, so I'll open another question for that.

What I want to know is how to tell QEMU, either via CLI or using virt-manager, to boot from the first partition on an USB drive, say /dev/sdb1, where the EFI directory of that system was. I've seen posts that deal with booting a USB Live Image created using dd, but I couldn't boot it. For example, when following the instructions here and here I just got a screen stuck at "Booting from Hard Drive...", but nothing else happens.

Should the /dev/sdb1 partition be mounted? Because I've tried it both ways, with the same result.

EDIT: Here's the partition table of the disk:

fdisk -l /dev/sdb
Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: 2115            
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: 55BB5701-6D3C-4BAC-A3DF-A70D195D1B7A

Device          Start        End    Sectors   Size Type
/dev/sdb1        2048    1050623    1048576   512M EFI System
/dev/sdb2     1050624 1911824383 1910773760 911.1G Linux filesystem
/dev/sdb3  1911824384 1953523711   41699328  19.9G Linux swap

Is this possible? Thanks!

  • Besides installing the drive again on a computer, is there a way of telling whether this is what is happening? If I connect it with my USB cask, the OS will read the number of logical sectors from this device, so I do not see how to know if this number changed from the real one. Mar 6 at 4:40
  • There are no changes in that regard; I'll post what fdisk -l tells me, in any case. Mar 6 at 5:05
  • IMO the partition table makes sense and the problem I mentioned does not occur here. Mar 6 at 5:09
  • 1
    Normally you do not boot from a partition, you boot from the disk: qemu-system-x86_64 -enable-kvm -drive file=/dev/sdb,format=raw,media=disk Mar 6 at 9:36
  • @ArtemS.Tashkinov: nope, it is still stuck at "Booting fom disk". Mar 6 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.