The block-device of a USB mass storage does not show up in Ubuntu 16.04
, while I positively can see it in Ubuntu 14.04
. Question: How can I make it show up in Ubuntu 16.04
?
NOTES:
- Both machines are virtual on the same hardware, so it is not cabling, wiring, power, connection, blah blah… Virtualization of the
USB
is identical and I have triple-checked it is not the problem. - In fact… the USB layer is properly detected both in
Ubuntu 14.04
andUbuntu 16.04
(see the logs below). - The block device
/dev/sdb
shows up inUbuntu 14.04
(as expected), but does not show up inUbuntu 16.04
(topic of this question). - The problem seems to be located in something named
usb-storage
which in theUbuntu 14.04
is bridging theUSB
into theSCSI
but seems to be missing in my installation of theUbuntu 16.04
.
Context
I have two Vagrant/VirtualBox machines. One with Ubuntu 14.04
and the other with Ubuntu 16.04
. In the host, I have a JMicron
-based dock with a 1T HD plugged in (chip product JMS56x
).
The drive is not formatted and has no partitions, I plan to use the raw-block device in a pool fo ZFS
.
I want to do the usage of the ZFS
from inside Ubuntu 16.04
.
In Ubuntu 14.04
I use the vagrant image config.vm.box = "ubuntu/trusty64"
and I already have usbutils
installed:
root@vagrant-ubuntu-trusty-64:/home/vagrant# apt list --installed | grep usb
WARNING: apt does not have a stable CLI interface yet. Use with caution in scripts.
libusb-0.1-4/trusty,now 2:0.1.12-23.3ubuntu1 amd64 [installed]
libusb-1.0-0/trusty,now 2:1.0.17-1ubuntu2 amd64 [installed]
usbutils/trusty,now 1:007-2ubuntu1 amd64 [installed]
I tell VirtualBox to connect the JMicron
and I successfully get the block-device as a SCSI
disk.
Before connecting
Before connecting the disk, I can see sda
and its unique partition sda1
:
root@vagrant-ubuntu-trusty-64:/home/vagrant# ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Nov 26 13:06 /dev/sda
brw-rw---- 1 root disk 8, 1 Nov 26 13:06 /dev/sda1
After connecting
After connecting, I can see both sda
and sdb
(in this case, sdb
with no partitions, as expected):
root@vagrant-ubuntu-trusty-64:/home/vagrant# ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Nov 26 13:06 /dev/sda
brw-rw---- 1 root disk 8, 1 Nov 26 13:06 /dev/sda1
brw-rw---- 1 root disk 8, 16 Nov 26 16:56 /dev/sdb
fdisk
gives coherent results with the /dev/sd*
listings.
So Ubuntu 14.04
behaves exactly as expected, as the the block device /dev/sdb
shows up.
In Ubuntu 16.04
I use the vagrant image config.vm.box = "gbarbieru/xenial"
and I don't have the usbutils
installed. I install them via apt install usbutils
and after that I get:
root@vagrant:/home/vagrant# apt list --installed | grep usb
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
libusb-0.1-4/xenial,now 2:0.1.12-28 amd64 [installed]
libusb-1.0-0/xenial,now 2:1.0.20-1 amd64 [installed,automatic]
usbutils/xenial,now 1:007-4 amd64 [installed]
I tell VirtualBox to connect the JMicron
and I do not get any extra block device and this is the main problem.
Before connecting
Before connecting the disk, I can see sda
and its several partitions sda1
, sda2
and sda5
:
root@vagrant:/home/vagrant# ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Nov 26 10:55 /dev/sda
brw-rw---- 1 root disk 8, 1 Nov 26 10:55 /dev/sda1
brw-rw---- 1 root disk 8, 2 Nov 26 10:55 /dev/sda2
brw-rw---- 1 root disk 8, 5 Nov 26 10:55 /dev/sda5
After connecting
After connecting, I cannot see in Ubuntu 16.04
any sdb
as I could see with the Ubuntu 14.04
:
root@vagrant:/home/vagrant# ls -l /dev/sd*
brw-rw---- 1 root disk 8, 0 Nov 26 10:55 /dev/sda
brw-rw---- 1 root disk 8, 1 Nov 26 10:55 /dev/sda1
brw-rw---- 1 root disk 8, 2 Nov 26 10:55 /dev/sda2
brw-rw---- 1 root disk 8, 5 Nov 26 10:55 /dev/sda5
fdisk
gives coherent results with the /dev/sd*
listings.
So Ubuntu 16.04
does not behave as expected because the block device /dev/sdb
does not show up. Nevertheless, the low-level USB device is in fact properly detected. See the logs:
Traces and logs
In Ubuntu 14.04
I get following traces in tail -f /var/log/kern.log
when connecting:
Nov 26 16:14:34 vagrant-ubuntu-trusty-64 kernel: [11313.532808] usb 1-1: new high-speed USB device number 3 using xhci_hcd
Nov 26 16:14:34 vagrant-ubuntu-trusty-64 kernel: [11313.553057] usb 1-1: New USB device found, idVendor=152d, idProduct=9561
Nov 26 16:14:34 vagrant-ubuntu-trusty-64 kernel: [11313.553060] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
Nov 26 16:14:34 vagrant-ubuntu-trusty-64 kernel: [11313.553062] usb 1-1: Product: JMS56x Series
Nov 26 16:14:34 vagrant-ubuntu-trusty-64 kernel: [11313.553064] usb 1-1: Manufacturer: JMicron
Nov 26 16:14:34 vagrant-ubuntu-trusty-64 kernel: [11313.553065] usb 1-1: SerialNumber: 00000000000000000000
Nov 26 16:14:34 vagrant-ubuntu-trusty-64 kernel: [11313.557954] usb-storage 1-1:1.0: USB Mass Storage device detected
Nov 26 16:14:34 vagrant-ubuntu-trusty-64 kernel: [11313.557991] scsi2 : usb-storage 1-1:1.0
Nov 26 16:14:35 vagrant-ubuntu-trusty-64 kernel: [11314.557915] scsi 2:0:0:0: Direct-Access WDC WD10 EAVS-00D7B1 0105 PQ: 0 ANSI: 6
Nov 26 16:14:35 vagrant-ubuntu-trusty-64 kernel: [11314.558304] sd 2:0:0:0: Attached scsi generic sg1 type 0
Nov 26 16:14:35 vagrant-ubuntu-trusty-64 kernel: [11314.564883] sd 2:0:0:0: [sdb] 1953525168 512-byte logical blocks: (1.00 TB/931 GiB)
Nov 26 16:14:35 vagrant-ubuntu-trusty-64 kernel: [11314.566221] sd 2:0:0:0: [sdb] Write Protect is off
Nov 26 16:14:35 vagrant-ubuntu-trusty-64 kernel: [11314.566225] sd 2:0:0:0: [sdb] Mode Sense: 47 00 10 08
Nov 26 16:14:35 vagrant-ubuntu-trusty-64 kernel: [11314.571284] sd 2:0:0:0: [sdb] No Caching mode page found
Nov 26 16:14:35 vagrant-ubuntu-trusty-64 kernel: [11314.572366] sd 2:0:0:0: [sdb] Assuming drive cache: write through
Nov 26 16:14:35 vagrant-ubuntu-trusty-64 kernel: [11314.579291] sd 2:0:0:0: [sdb] No Caching mode page found
Nov 26 16:14:35 vagrant-ubuntu-trusty-64 kernel: [11314.579651] sd 2:0:0:0: [sdb] Assuming drive cache: write through
Nov 26 16:14:36 vagrant-ubuntu-trusty-64 kernel: [11315.056332] sdb: unknown partition table
Nov 26 16:14:36 vagrant-ubuntu-trusty-64 kernel: [11315.066919] sd 2:0:0:0: [sdb] No Caching mode page found
Nov 26 16:14:36 vagrant-ubuntu-trusty-64 kernel: [11315.067273] sd 2:0:0:0: [sdb] Assuming drive cache: write through
Nov 26 16:14:36 vagrant-ubuntu-trusty-64 kernel: [11315.070669] sd 2:0:0:0: [sdb] Attached SCSI disk
Instead, in Ubuntu 16.04
I get those traces in tail -f /var/log/kern.log
when connecting the device:
Nov 26 11:14:59 vagrant kernel: [ 1178.761744] usb 1-1: new high-speed USB device number 4 using xhci_hcd
Nov 26 11:14:59 vagrant kernel: [ 1179.088626] usb 1-1: New USB device found, idVendor=152d, idProduct=9561
Nov 26 11:14:59 vagrant kernel: [ 1179.088632] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=5
Nov 26 11:14:59 vagrant kernel: [ 1179.088636] usb 1-1: Product: JMS56x Series
Nov 26 11:14:59 vagrant kernel: [ 1179.088638] usb 1-1: Manufacturer: JMicron
Nov 26 11:14:59 vagrant kernel: [ 1179.088641] usb 1-1: SerialNumber: 00000000000000000000
The first missing line is:
usb-storage 1-1:1.0: USB Mass Storage device detected
So comparing both logs, it seems that "something named usb-storage
" is not present. Probably the usb-storage
thing is the bridge to the SCSI
.
Questions
- Is
usb-storage
still the way to go in 2016? Or shoud I use another bridge? - How do I get the
usb-storage
thing active in theUbuntu 16.04
so it continues the process, exposes the storage to theSCSI
and I get the/dev/sdb
block device listed?
Best Answer
Try to run
modprobe usb-storage
ormodprobe usb_storage
before connecting the USB disk. Does it change anything?