Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Can't mount a FAT32 USB thumb drive. No partition or UUID?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
acidrums4
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2009
Posts: 136
Location: Al otro lado del monitor

PostPosted: Fri Aug 25, 2017 11:19 pm    Post subject: Can't mount a FAT32 USB thumb drive. No partition or UUID? Reply with quote

I've got a Sony 8 GB thumb drive which I gave format with a Windows machine so I could copy Sherlock episodes on it and watch them on my TV. I also could got a "new" PC and installed Gentoo on it, to replace an old Compaq C700 I had.

But when I plug the thumb drive onto the PC, nothing happens. dmesg says kernel recognizes it, but does not set up a partition (no "sdb: sdb1" line...):
Code:
[33977.808541] usb 1-1.5: new high-speed USB device number 3 using ehci-pci
[33977.892010] usb 1-1.5: New USB device found, idVendor=054c, idProduct=05b8
[33977.892014] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[33977.892017] usb 1-1.5: Product: Storage Media
[33977.892019] usb 1-1.5: Manufacturer: Sony
[33977.892022] usb 1-1.5: SerialNumber: FBA4304FFF2B73
[33977.892926] usb-storage 1-1.5:1.0: USB Mass Storage device detected
[33977.892986] scsi host6: usb-storage 1-1.5:1.0
[33979.330286] scsi 6:0:0:0: Direct-Access     Sony     Storage Media    0100 PQ: 0 ANSI: 6
[33979.330421] sd 6:0:0:0: Attached scsi generic sg2 type 0
[33979.331526] sd 6:0:0:0: [sdb] 15228928 512-byte logical blocks: (7.80 GB/7.26 GiB)
[33979.332649] sd 6:0:0:0: [sdb] Write Protect is off
[33979.332655] sd 6:0:0:0: [sdb] Mode Sense: 43 00 00 00
[33979.333770] sd 6:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[33979.343525] sd 6:0:0:0: [sdb] Attached SCSI removable disk


And fdisk -l says there is the partition:
Code:
Disk /dev/sdb: 7.3 GiB, 7797211136 bytes, 15228928 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: 0x004f09f2

Device     Boot Start      End  Sectors  Size Id Type
/dev/sdb1  *     2048 15228927 15226880  7.3G  7 HPFS/NTFS/exFAT


But here's the thing: the special device file /dev/sdb1 does not exist:
Code:
% ls /dev/sd*
/dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4  /dev/sda5  /dev/sdb


And lsblk doesn't show the partition, either:
Code:
NAME MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb    8:16   1   7,3G  0 disk
sr0   11:0    1  1024M  0 rom
sda    8:0    0 465,8G  0 disk
sda4   8:4    0  39,1G  0 part /
sda2   8:2    0   128M  0 part
sda5   8:5    0 418,8G  0 part /home
sda3   8:3    0   7,8G  0 part [SWAP]
sda1   8:1    0     2M  0 part


Same thing with blkid, which shows there's no UUID on it (I don't know if UUIDs are just for partitions, though, but seems weird to me that it lists a PTUUID):
Code:
/dev/sda2: UUID="71fbf1dd-51ff-4554-b17c-bf4adb9b55d9" UUID_SUB="c61f413b-c504-4986-863b-49b15d5260c5" TYPE="btrfs" PARTLABEL="boot" PARTUUID="a2ea
fdea-61af-4cf5-bbaa-de49ba02b263"
/dev/sda3: UUID="3156f3ad-2774-489d-9a38-46338ae39b44" TYPE="swap" PARTLABEL="swap" PARTUUID="f07d4740-1154-4180-9bbd-c087b15bc3f3"
/dev/sda4: UUID="966473b9-c959-4f10-bbf6-aa05b76e3e46" TYPE="xfs" PARTLABEL="rootfs" PARTUUID="e591e0d6-87cc-4206-bb47-4e9ecb872f40"
/dev/sda5: UUID="f4fb3e09-40d5-4048-ab16-0fe1d3d9b6f5" UUID_SUB="fb48a0fc-3ba9-4992-b3b9-61155e41f825" TYPE="btrfs" PARTLABEL="home" PARTUUID="2bb8
4932-3cf8-405d-bd50-65cd37d30ce4"
/dev/sda1: PARTLABEL="grub" PARTUUID="314d8418-d356-48ad-8347-da7f9fbc5d86"
/dev/sdb: PTUUID="004f09f2" PTTYPE="dos"


Meanwhile, parted shows this:
Code:
Model: Sony Storage Media (scsi)
Disk /dev/sdb: 7797MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  7797MB  7796MB  primary  fat32        boot


Obviously, I can't just try to mount /dev/sdb because that's against the rules - ell, yes, I tried, but it says "exFAT file system is not found". Just to check if that was something about the thumb drive, I booted my PC (the same PC I'm using with Gentoo) with an elementary live iso and it worked, so the thumb drive isn't to blame. And I plugged said elementary thumb drive on Gentoo, and it mounted and worked as it should do...

I checked and re-checked my kernel config and there's support for fat/exfat filesystems, and exfat-utils and fuse-exfat are installed. I can't tell if this something 'udisks2' or kernel related. I googled around for a few days looking for something similar, but I wasn't able to find a thing so here's why I came to ask for your help. Is there something I'm missing? Thanks in advance for any clue!

* The ouput of 'emerge --info' can be found here, just in case.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Sat Aug 26, 2017 12:14 am    Post subject: Reply with quote

Maybe try a partprobe:
Code:
# partprobe /dev/sdb
Back to top
View user's profile Send private message
acidrums4
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2009
Posts: 136
Location: Al otro lado del monitor

PostPosted: Sat Aug 26, 2017 12:22 am    Post subject: Reply with quote

russK wrote:
Maybe try a partprobe:
Code:
# partprobe /dev/sdb

It worked! Thanks! I had no idea about that command.
But that means I need to execute partprobe every time I connect this thing?
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 630

PostPosted: Sat Aug 26, 2017 12:47 am    Post subject: Reply with quote

I would have thought some kind of udev thing would take care of this for you. You have systemd, is your systemd-udevd.service active?
Code:
# systemctl status systemd-udevd

If it is not active maybe that's why the kernel did not know about the partitions. It's been a long time mine has just worked so I'm not totally sure.

HTH
Back to top
View user's profile Send private message
acidrums4
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2009
Posts: 136
Location: Al otro lado del monitor

PostPosted: Sat Aug 26, 2017 12:52 am    Post subject: Reply with quote

russK wrote:
I would have thought some kind of udev thing would take care of this for you. You have systemd, is your systemd-udevd.service active?

Yep, it's active. I was thinking about the same thing. Which is weird, because on my old Gentoo machine I didn't needed such thing, but well... Guess I'd need to start messing around with udev rules.

However, thank you so much! :)
Back to top
View user's profile Send private message
acidrums4
Tux's lil' helper
Tux's lil' helper


Joined: 05 Feb 2009
Posts: 136
Location: Al otro lado del monitor

PostPosted: Sun Aug 27, 2017 9:59 pm    Post subject: Reply with quote

Just in case anyone ever has this same issue and got in here, this is a little udev rule that I came across to get this thing working. Thanks to udev devs for the easy and kind of intuitive syntax of udev rules.

Create a file called "11-populate-media-partitions.rules" (or any name you think would be appropiate) under /etc/udev/rules.d/, containing the following:
Code:
ACTION=="add",KERNEL=="sd[b-z]",SUBSYSTEMS=="usb", RUN+="/usr/sbin/partprobe /dev/%k"

Note that on the "KERNEL" string I'm omitting /dev/sda as there's where my hard disk partitions are located.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum