[SOLVED] QEMU - Failed to initialize USB device 'usb-storage': Block node is read-only
Linux - Virtualization and CloudThis forum is for the discussion of all topics relating to Linux Virtualization and Linux Cloud platforms. Xen, KVM, OpenVZ, VirtualBox, VMware, Linux-VServer and all other Linux Virtualization platforms are welcome. OpenStack, CloudStack, ownCloud, Cloud Foundry, Eucalyptus, Nimbus, OpenNebula and all other Linux Cloud platforms are welcome. Note that questions relating solely to non-Linux OS's should be asked in the General forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
QEMU - Failed to initialize USB device 'usb-storage': Block node is read-only
I'm using QEMU version 2.10.1(Debian 1:2.10+dfsg-0ubuntu3.1) on an Ubuntu 17.10 64-bit system. I'm trying to start a VM with USB drive attached with the following command -
I have a USB drive mounted on /media/drive/drive. I get the following response
Code:
qemu-system-i386: -usbdevice disk:format=raw:fat:/media/drive/drive/: '-usbdevice' is deprecated, please use '-device usb-...' instead
qemu-system-i386: -usbdevice tablet: '-usbdevice' is deprecated, please use '-device usb-...' instead
WARNING: Image format was not specified for 'kolibri.img' and probing guessed raw.
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
vvfat /media/drive/drive/ chs 1024,16,63
qemu-system-i386: -usbdevice disk:format=raw:fat:/media/drive/drive/: Failed to initialize USB device 'usb-storage': Block node is read-only
qemu-system-i386: -usbdevice disk:format=raw:fat:/media/drive/drive/: could not add USB device 'disk:format=raw:fat:/media/drive/drive/'
I can create files on /media/drive/drive with current user permissions. How do I fix it for the VM to start with the USB drive attached?
'-usbdevice' is deprecated, please use ---> '-device usb-...
did you try that yet?
and this is what it is doing making read only
Code:
Automatically detecting the format is dangerous for raw images, write operations on block 0 will be restricted.
Specify the 'raw' format explicitly to remove the restrictions.
gives examples of using the proper update calls ( -device usb- ) to mount usb device.
looks like you missed a step,
is it written like this
Code:
-device usb-host,hostbus=2,hostaddr=3 to add the host's USB device at Bus 2, Device 3. Simple as that.
lsusb gives me this
Code:
Bus 005 Device 002: ID 04e8:6860 Samsung Electronics Co., Ltd Galaxy (MTP)
#that tell me I should write it as such
-device usb-host,hostbus=5,hostaddr=2
try writing it like that, but looking again you did, I suppose, then ther is tis]
Quote:
This HOWTO is limited to UHCI devices (no USB2 EHCI).
I found this on how to see what type of USB controler you're dealing with,
$ lsusb
Bus 001 Device 004: ID 0bda:5776 Realtek Semiconductor Corp.
Bus 001 Device 003: ID 0bda:b001 Realtek Semiconductor Corp.
Bus 001 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 013: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
Bus 002 Device 012: ID 04ca:0061 Lite-On Technology Corp.
Bus 002 Device 011: ID 413c:2107 Dell Computer Corp.
Bus 002 Device 010: ID 0781:5567 SanDisk Corp. Cruzer Blade
Bus 002 Device 009: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Here "SanDisk Cruzer Blade" is my USB drive. So the hostbus and hostaddr values seem to be correct.
EDIT: It seems I was missing the -usb option to enable the USB driver. Thank you very much for the help!
Last edited by nisargshah95; 01-15-2018 at 08:54 AM.
Reason: add info
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.