qvm-block does not work for hard drives?

439 views
Skip to first unread message

Robert William Fuller

unread,
Apr 22, 2013, 10:12:06 AM4/22/13
to qubes...@googlegroups.com
Hi,

If I plug in a USB stick, I can successfully share the block device with
an app VM by doing the following:

qvm-block -a work dom0:sdc

I have a second hard drive in my computer with Windows 7 on it whose
files I would like to access. The file system on the drive is not
mounted in dom0, although it could be. So, I try to do the following:

qvm-block -a work dom0:sdb

However, for a hard drive, this fails with the following error:

qvm-block: error: Invalid device name: dom0:sdb

I notice that when a USB stick is inserted, the Qubes desktop says
something about it being attached. Then, the block device appears in
qvm-block -l. This is not true for a hard drive that is already in the
system when it boots. Is there a way to make qvm-block aware of hard
drives that are in the system on boot? Or is that not the problem?

Thank you.

Rob

Joanna Rutkowska

unread,
Apr 22, 2013, 12:23:10 PM4/22/13
to Robert William Fuller, qubes...@googlegroups.com
We explicitly hide _mounted_ disks from qubes-block-device list:

http://git.qubes-os.org/?p=marmarek/core-admin.git;a=blob;f=linux/aux-tools/startup-misc.sh;h=57d06c82749d93cb348e48a2556e91c8984c07ed;hb=HEAD#l15

... so perhaps your other disk is auto-mounted upon your dom0 boot?
Check your /etc/fstab and try to disable this auto-mounting.

You can, of course check, if it's mounted using mount or df, right? But
unmounting it manually will not help (I think), you must prevent it from
being mounted on startup.

joanna.

signature.asc

Marek Marczykowski

unread,
Apr 22, 2013, 1:25:02 PM4/22/13
to Joanna Rutkowska, Robert William Fuller, qubes...@googlegroups.com
You can force rediscover of block devices (when you unmount the disk):
udevadm trigger --action=change

--
Best Regards / Pozdrawiam,
Marek Marczykowski
Invisible Things Lab

signature.asc

Robert William Fuller

unread,
Apr 22, 2013, 3:09:31 PM4/22/13
to qubes...@googlegroups.com
I am a Linux admin (among other things.) Naturally, I made sure that
nothing from the second SATA hard drive was mounted in dom0 by checking
both df and mount. (I suppose that I could cat /proc/mounts too, but
that is just overkill.) I also checked /etc/fstab per your suggestion.

I tried "udevadm trigger --action=change". That did not make the device
appear to "qvm-block -l".

I tried "udevadm trigger --action=change --verbose" to show what devices
are triggered. "sdb" is listed among the triggered devices.

And yes, I am using the dom0 Terminal and it says "dom0" in the title
bar. Maybe I need to look at the startup-misc.sh script. I am at work
right now, so I am a little time limited.

Thank you.

Rob

Joanna Rutkowska

unread,
Apr 22, 2013, 4:48:38 PM4/22/13
to Robert William Fuller, qubes...@googlegroups.com
Right, you actually wrote in your original message that your disk is not
mounted, sorry I missed that.

Anyway, do you see your device in the list returned by the following
command:

xenstore-list /local/domain/0/qubes-block-devices

?

joanna.

signature.asc

Robert William Fuller

unread,
Apr 23, 2013, 8:55:36 AM4/23/13
to qubes...@googlegroups.com
No. I sure do not see it. Here is the output from xenstore-list:

loop1
loop0
loop2
loop4
loop3
loop5
loop6

And from "losetup -a":

/dev/loop0: []: (/var/lib/qubes/vm-templates/fedora-18-x64/root.img)
/dev/loop1: []: (/var/lib/qubes/vm-templates/fedora-18-x64/root-cow.img)
/dev/loop2: []: (/var/lib/qubes/servicevms/netvm/volatile.img)
/dev/loop3: []: (/var/lib/qubes/vm-kernels/3.7.6-2/modules.img)
/dev/loop4: []: (/var/lib/qubes/servicevms/netvm/private.img)
/dev/loop5: []: (/var/lib/qubes/servicevms/firewallvm/private.img)
/dev/loop6: []: (/var/lib/qubes/servicevms/firewallvm/volatile.img)

Rob

Joanna Rutkowska

unread,
Apr 23, 2013, 5:44:16 PM4/23/13
to Robert William Fuller, qubes...@googlegroups.com
Hm, I would recommend that you try some debugging of this issue
yourself. We all actually run Qubes on laptops, which all have just one
SATA disk, so your case is hard to reproduce. You can try adding some
logging to startup-misc.sh (even simple echo XXX > /tmp/mylog), and also
the udev scripts, try to see at which point is your disk device being
filtered out.

joanna.

signature.asc

Laszlo Zrubecz

unread,
Apr 23, 2013, 6:46:44 PM4/23/13
to qubes...@googlegroups.com
On 23 April 2013 23:44, Joanna Rutkowska <joa...@invisiblethingslab.com> wrote:

> Hm, I would recommend that you try some debugging of this issue
> yourself. We all actually run Qubes on laptops, which all have just one
> SATA disk,

Actually I have 2 sata disks, but not any problem to use them...

Robert William Fuller

unread,
Apr 29, 2013, 9:01:04 AM4/29/13
to qubes...@googlegroups.com
The startup-misc.sh script pointed to a work-around. I do the following
to get /dev/sdb recognized by qvm-block:

export dev=/dev/sdb; eval `udevadm info -q property -n $dev|sed -e
's/\([^=]*\)=\(.*\)/export \1="\2"/'`; /usr/lib/qubes/udev-block-add-change

Now I can get my second hard drive passed to my appVM using qvm-block.
I realize there is still a bug somewhere that needs to be fixed, but at
least this gets me closer to using Qubes as my default desktop. Once it
is my default desktop I should have more time to root out the bug. I
suspect it is in the udev scripts.

How is beta3 coming? That might influence when I make the switch.

Thank you.

Rob
Reply all
Reply to author
Forward
0 new messages