2

I've been trying to mount a USB drive that's formatted as FAT32, and getting an error. The drive works fine on Windows machines.

When I try to mount it with sudo mount -t vfat /dev/sdb1 /media/usbdev, I get

mount:  /dev/sdb1 is not a block device.

When I try to mount /dev/sdb to the same place (sudo mount -t vfat /dev/sdb /media/usbdev), I get

mount: wrong fs type, bad option, bad superblock on /dev/sdb,
       missing codepage or helper program, or other error
   In some cases useful info is found in syslog - try
   dmesg | tail or so.

I've tried Googling around and searching this site. 1 and 2 seem like the most relevant questions, but the solutions proposed there haven't worked. I've tried adding a line to /etc/fstab (/dev/sdb1 /media/usbdev vfat defaults 0 0), also to no avail. I'm pretty confused - what's going on, and what can I do to mount this USB drive? I'd rather not reformat it since I have some important data on there.


Here's what lsblk returns:

NAME                  MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sdb                     8:16   1  29.9G  0 disk  
└─sdb1                  8:17   1  29.9G  0 part  
sda                     8:0    0 119.2G  0 disk  
├─sda2                  8:2    0   488M  0 part  /boot
├─sda3                  8:3    0 118.3G  0 part  
│ └─sda3_crypt        253:0    0 118.3G  0 crypt 
│   ├─mint--vg-root   253:1    0 110.4G  0 lvm   /
│   └─mint--vg-swap_1 253:2    0   7.9G  0 lvm   
│     └─cryptswap1    253:3    0   7.9G  0 crypt [SWAP]
└─sda1                  8:1    0   512M  0 part  /boot/efi

And here's the relevant portion of sudo fdisk -l:

Disk /dev/sdb: 29.9 GiB, 32078036992 bytes, 62652416 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos 
Disk identifier: 0xc3072e18

Device Boot Start End Sectors Size Id Type /dev/sdb1 96 62652415 62652320 29.9G c W95 FAT32 (LBA)

dmesg |tail shows the following:

[152334.491944]  sdb: sdb1 [152334.493759] sd 3:0:0:0: [sdb] Attached
SCSI removable disk [153063.602803]  sdb: sdb1

So, it seems like the device is being recognized - it just won't mount.

I'm new to Linux, so please let me know if I should provide more information. Thanks in advance.

  • Try mounting with -t fat and -o fat=32 – Raman Sailopal Aug 04 '17 at 13:05
  • @RamanSailopal No luck... sudo mount -t fat /dev/sdb1 /media/usbdev returns mount: unknown filesystem type 'fat' and sudo mount -o fat=32 /dev/sdb1 /media/usbdev returns mount: /dev/sdb1 is not a block device – penGuinKeeper Aug 04 '17 at 13:08
  • Returns what? What's the message returned and the output from dmesg? – Raman Sailopal Aug 04 '17 at 13:10
  • dmesg | tail shows [158362.425970] sd 3:0:0:0: [sdb] 62652416 512-byte logical blocks: (32.1 GB/29.9 GiB) [158362.426678] sd 3:0:0:0: [sdb] Write Protect is off [158362.426680] sd 3:0:0:0: [sdb] Mode Sense: 43 00 00 00 [158362.427394] sd 3:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [158362.430942] xhci_hcd 0000:00:14.0: WARN Event TRB for slot 7 ep 4 with no TDs queued? [158362.432276] sdb: sdb1 [158362.433792] sd 3:0:0:0: [sdb] Attached SCSI removable disk – penGuinKeeper Aug 04 '17 at 13:12
  • fat isn't a Linux filesystem type, you want vfat. (the older one is msdos). See man mount, "fat is not a separate filesystem, but a common part of the msdos, umsdos and vfat filesystems". – sourcejedi Aug 04 '17 at 15:10
  • @sourcejedi ls -l /dev/sdb1 returns cr-------- 1 root root 8, 17 Aug 3 15:37 /dev/sdb1. I'll try rebooting.

    edit: Rebooting worked! Thanks! ls -l /dev/sdb1 now returns brw-rw---- 1 root disk 8, 17 Aug 5 01:10 /dev/sdb1 Can I accept your comment as the answer?

    – penGuinKeeper Aug 04 '17 at 19:39
  • 1
    Done. wow, something overrwrote it with a character device with the same major and minor number (8, 17) :-D. That's so weird. – sourcejedi Aug 04 '17 at 21:23

1 Answers1

2

"Is not a block device" is pretty specific. It suggests you've accidentally overwritten the block device with a regular file at some point. In this case, ls -l /dev/sdb1 will show something other than b in the first column. Here's an example from my system:

$ ls -l /dev/sda1
brw-rw----. 1 root disk 8, 1 Aug  3 08:32 /dev/sda1

- in the first column means a regular file. d is a directory. b is a block device node. c is a character device node. p is a named pipe. s should be a named unix socket, I think.

This particular problem should go away if you just reboot. /dev/ is a tmpfs, it is recreated from scratch on each boot.

sourcejedi
  • 50,249