On Ubuntu, I'm trying to mount my USB
[] dmesg
... USB Mass Storage support registered.
... scsi 2:0:0:0 Direct-Access Kingston DataTraveler 2.0
... sd 2:0:0:0 [sdb] 15679488 512-byte logical blocks: (8.02 GB/7.47 GiB)
... sd 2:0:0:0 Write Protect is off
(so I assume that /dev/sdb is my USB pendrive)
[] mkdir /mnt/usb
[] mount /dev/sdb /mnt/usb
mount: mounting /dev/sdb on /mnt/usb failed: Invalid ArgumentI also tried with "-t ext4" with no success. What am I doing wrong? Thank you very much.
43 Answers
/dev/sdb represents the whole storage device. The individual partitions are addressed by numbers following the device name, e.g. sdb1 is the 1st partition in the storage device sdb. As USB flash drives usually have only one partition, the mount command should be:
mount /dev/sdb1 /mnt/usb sda or sdb is just the name of your storage device, if you want to mount it you must enter the partition number too.
mkdir -p /media/usb
mount /dev/sdb1 /media/usb Since this is among the top results I want to share some insight about what happened to me and how I solved it.
My situation is that I'm booting the 18.04 di-based server installer and I want to mount another (virtual) optical disc drive. Which gave me this exact error message.
Observation:
- I'm in a busybox shell, which may behave different than GNU tools.
- I have a different, limited kernel running. While the error message gave no indication and all arguments seemed to be correct I tried loading the filesystem module, iso9660 in my case, with modprobe. Then it worked. So whatever filesystem you are trying to mount, you should check (lsmod?) that the respective filesystem module is loaded to. It's unlikely that the OP was on busybox, but hey questions with not enough context are common and we are trying to solve them.