#692249 sata boot+grub unknown filesystem without boot=on

Package:
qemu-kvm
Source:
qemu
Submitter:
Gianluigi Tiesi
Date:
2025-07-28 19:57:03 UTC
Severity:
minor
Tags:
#692249#5
Date:
2012-11-04 04:49:47 UTC
From:
To:
Hi, I've noticed my kvm warns about using boot=on so I've decided to find some documentation,
as I found boot=on enables extboot option rom removed upstream because seabios can boot directly
from sata. References in #652447, perhaps I was able to boot as linux vm from a scsi disk using
latest seabios code without using lsi proprietary rom (maybe they implemented scsi boot).

if I run:
vm -m 1024 -snapshot -device ahci,id=ahci0,bus=pci.0,addr=0x5 -drive file=/dev/sda,if=none,id=drive-sata0-0-0,format=raw,boot=on -device ide-hd,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0

kvm complains about deprecated boot=on, grub loads and it can boot

but if I run:
kvm -m 1024 -snapshot -device ahci,id=ahci0,bus=pci.0,addr=0x5 -drive file=/dev/sda,if=none,id=drive-sata0-0-0,format=raw -device ide-hd,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0

grub loads but it's unable to identify the filesystem

my ptable:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     3071999     1534976    7  HPFS/NTFS/exFAT
/dev/sda2         3072000   236963839   116945920    7  HPFS/NTFS/exFAT
/dev/sda3       318883840   351649791    16382976    7  HPFS/NTFS/exFAT
/dev/sda4       236963840   318883839    40960000   83  Linux

sda4 is ext4, and I'm trying to boot my windows from my linux

maybe seabios it's unable to correcly map whole drive?

Regards

#692249#10
Date:
2012-12-29 14:57:44 UTC
From:
To:
04.11.2012 08:49, Gianluigi Tiesi wrote:

This is not scsi, this is ahci, FWIW.
this does not boot at all with current seabios+qemu-kvm from
wheezy: guest bios does not find any boot device.  If in your
case guest bios finds the boot device and loads grub, it must
be some other version of either qemu-kvm or seabios.

But at any rate, you forgot one more parameter: it is bootindex.
Try this:

  kvm -m 1024 -snapshot \
   -device ahci,id=ahci0,bus=pci.0,addr=0x5 \
   -drive file=/dev/sda,if=none,id=drive-sata0-0-0,format=raw \
   -device ide-hd,bus=ahci0.0,drive=drive-sata0-0-0,id=sata0-0-0,bootindex=0

This works here just fine.

Does it answer your question/issue?

Nope, it is completely unrelated.  For any virtual disk drive
given by qemu to the guest - no matter at all which it is on
the host - the guest (including the bios) sees it just like
a regular disk drive.  It is up to qemu to make the host
representation of it completely transparent, and qemu does a
good job in there.

Thanks,

/mjt

#692249#17
Date:
2012-12-30 20:43:40 UTC
From:
To:
Yes true, but boot=on option was made for scsi, so why it makes work my
ahci setup that instead would not work? I mean it should be unrelated
but instead looks like related.

I'm on sid, and the just updated seabios 1.7.1-1 exposes same behavior
qemu-kvm is 1.1.2+dfsg-3

Unfortunately bootindex options changes nothing

here grub2 without boot=on

Booting from Hard Disk...
GRUB loading.
Welcome to GRUB!

error: unknown filesystem.
Entering rescue mode...
grub rescue> ls
(hd0) (hd0,msdos4) (hd0,msdos3) (hd0,msdos2) (hd0,msdos1) (fd0)
grub rescue> ls (hd0,msdos4)
error: unknown filesystem.

while it works fine with boot=on

Grub2 files are in my currently mounted root partition

Regards

#692249#22
Date:
2012-12-30 21:03:40 UTC
From:
To:
31.12.2012 00:43, Gianluigi Tiesi wrote:
[]

Well.  boot=on was made for general usage, it works (or worked) for
any bootable device, including scsi and ahci and network and other
stuff.  It was a quick hack to allow booting from devices not
directly supported by seabios, and is not supported by upstream
anymore.

Interesting.  Okay.  So I need some way to reproduce this.
Can you please tell us what do you use as the guest?  What
is it, how it was setup, etc?  Maybe it is enough to do a
fresh install of some distribution to expose this issue?

[]

Ok.

Oh well.  It looks like grub is unable to _read_ the drive.

I need a way to reproduce this :)

I'll try doing some installing/booting here when time permits.
Maybe you can provide some instructions or maybe a guest image
to speed things up... ;)

Ok.  So it appears to be some grub+seabios issue with the
correct/modern way of booting things, while old/legacy boot
option works fine.

Thank you!

/mjt

#692249#27
Date:
2014-08-02 06:37:20 UTC
From:
To:
Hello.

Do you still remember this old bug from late-2012?  Do you still have any issues
outlined there?  I weren't able to reproduce it meantime, and both qemu and
seabios undergone several releases.

Can we close this bugreport now maybe? :)

Thanks,

/mjt

31.12.2012 01:03, Michael Tokarev wrote:

#692249#32
Date:
2014-08-06 20:14:35 UTC
From:
To:
qemu removed the option and grub still says unknown filesystem
You can close the bug I don't think it's a really an useful scenario,
I was trying to boot my win7 partition with kvm using -snapshot, it
wouldn't work anyway

Thanks and Regards

#692249#37
Date:
2014-08-07 06:51:08 UTC
From:
To:
07.08.2014 00:14, Gianluigi Tiesi wrote:

Yes, we removed the old option long time ago.  But I was really
worried about this unknown filesystem.

You're Very Wrong (tm).

Lots of people do this all the time, me included.  I've a dual-boot machine
(with windows and linux), and while I don't reboot into windows often, but
I do run it in qemu/kvm quite often, giving qemu my /dev/sda and choosing
to boot windows there.

It works just fine either way.  It even keeps its activation (win7 OEM), because
I pass /sys/firmware/acpi/tables/SLIC to the guest, the same as this PC was
shipped with.

I ran _many_ systems initially installed on a bare metal in qemu/kvm, just
giving qemu their hdd directly (with or without -snapshot), and I run many
systems initially installed in qemu/kvm on bare metal, after copying their
hdd image to real hdd.  Actually I installed all our windows machines at
office this way - initially in qemu, copying to hdd with all installed and
configured progs.  All this without changing the systems in question in
any noticeable way -- with the exception that initial boot of windows in
"foreign" environment requires installing a compatible driver, which is,
for metal=>qemu case, either "generic IDE" or ahci/sata.  Linux systems
works without any modifications at all.

As I already said, there's somethig wrong on your system.  It shuoldn't
work (or, rather, fail) like this.  It smells like a bug which I want to
find and fix.

Thanks,

/mjt

#692249#42
Date:
2014-08-07 13:07:35 UTC
From:
To:
lol

Please tell me what to do, the command line in the bug report loads grub
correctly but then grub:


SeaBIOS (version 1.7.5-20140531_083030-gandalf)

iPXE (http://ipxe.org) 00:03.0 C980 PCI2.10 PnP PMM+3FF94B40+3FEF4B40 C980

Booting from Hard Disk...
error: unknown filesystem.
Entering rescue mode...
grub rescue> ls (hd0,msdos3)/
error: unknown filesystem.
grub rescue>

but partition 3 is ext4, maybe because is mounted?

Regards