Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Unable to read content off USBs in gentoo install
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
quentin-k
n00b
n00b


Joined: 11 Jan 2020
Posts: 4

PostPosted: Sat Jan 25, 2020 5:27 am    Post subject: Unable to read content off USBs in gentoo install Reply with quote

When I'm on the live gentoo usb I can mount my USBs and interact with the contents on them, however I run into some issues in my gentoo install. For context, I use a usb wireless adapter and it works, so I know I kernel modules for USBs. When I plug in a usb the lights on the usb flash so I know it has been detected. When I run an lsusb while I have a usb plugged in I get the output:
Code:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 005: ID 0bda:57f3 Realtek Semiconductor Corp.
Bus 001 Device 004: ID 04ca:3015 Lite-On Technology Corp.
Bus 001 Device 003: ID 0bda:8179 Realtek Semiconductor Corp. RTL8188EUS 802.11n Wireless Network Adapter
Bus 001 Device 002: ID 046d:c332 Logitech, Inc. G502 Proteus Spectrum Optical Mouse
Bus 001 Device 006: ID 13fe:6300 Kingston Technology Company Inc.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

the output of an lsblk is :
Code:
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 238.5G  0 disk
├─sda1   8:1    0   260M  0 part
├─sda2   8:2    0     4G  0 part [SWAP]
└─sda3   8:3    0 234.2G  0 part /
sdb      8:16   1  57.7G  0 disk
sr0     11:0    1  1024M  0 rom 

when I do an fdisk on /dev/sdb I get:
Code:

 sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.33.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p
Disk /dev/sdb: 57.7 GiB, 61945675776 bytes, 120987648 sectors
Disk model: USB DISK 3.0   
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: 0x68a1d030

Device     Boot Start       End   Sectors  Size Id Type
/dev/sdb1       36224 120987647 120951424 57.7G  c W95 FAT32 (LBA)

Command (m for help): q

I'm fairly certain it's an issue with my kernel config. I'm using the 4.19.86 kernel, I'm not sure how I should share my kernel, but I will provide the information requested. Thanks in advance for the help and best regards, quentin-k!
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 14957

PostPosted: Sat Jan 25, 2020 5:08 pm    Post subject: Reply with quote

Since fdisk provided that output, I think we can assume that the device uses an MBR partition, not GPT. Do you have MBR support in your custom kernel? You might not, if you used GPT for your onboard disk and stripped out everything you didn't need. You say you cannot mount the USB device from your custom kernel. What happens when you try? You didn't show the command you used or any error output from it, and there are several ways this could fail. Please show the output of:
Code:
mkdir -p /mnt/usb
file -s /dev/sdb /dev/sdb1
mount -o ro -t auto /dev/sdb1 /mnt/usb
dmesg | tail -n20
You can use a different mountpoint if you prefer. I just want to see the attempt to mount the device somewhere, and to do it without expecting /etc/fstab to be right.

If you want to share your kernel, you can use wgetpaste to upload your kernel configuration (the .config file) to a pastebin site. wgetpaste is provided by app-text/wgetpaste. On success, it will print a short URL that you can post here, and for a few days afterward, we will be able to visit that URL to see your kernel configuration.
Back to top
View user's profile Send private message
quentin-k
n00b
n00b


Joined: 11 Jan 2020
Posts: 4

PostPosted: Sat Jan 25, 2020 5:42 pm    Post subject: Reply with quote

I ran the commands, I got some interesting output from the
Code:
file -s /dev/sdb /dev/sdb1
command, it was:
Code:
/dev/sdb:  DOS/MBR boot sector MS-MBR XP english at offset 0x12c "Invalid partition table" at offset 0x144 "Error loading operating system" at offset 0x163 "Missing operating system", disk signature 0x68a1d030; partition 1 : ID=0xc, start-CHS (0x2,27,1), end-CHS (0xd8,64,1), startsector 36224, 120951424 sectors

I used the directory /media/usb, the command I issued for it was
Code:
mkdir -p /media/usb
, It worked just fine. when I did
Code:
 mount -o ro -t auto /dev/sdb1 /media/usb
I got the output:
Code:
mount: /media/usb: special device /dev/sdb1 does not exist.
, I think that has to do with the error from
Code:
file -s /dev/sdb /dev/sdb1
and the output from
Code:
 dmesg | tail -n20
was
Code:
[133289.780793] Bulk status result = 0
[133289.780799] Bulk Status S 0x53425355 T 0x7ec R 0 Stat 0x0
[133289.780804] scsi cmd done, result=0x0
[133289.780823] *** thread sleeping
[133291.828673] *** thread awakened
[133291.828680] Command TEST_UNIT_READY (6 bytes)
[133291.828684] bytes: 00 00 00 00 00 00
[133291.828691] Bulk Command S 0x43425355 T 0x7ed L 0 F 0 Trg 0 LUN 0 CL 6
[133291.828694] xfer 31 bytes
[133291.828728] Status code 0; transferred 31/31
[133291.828730] -- transfer complete
[133291.828733] Bulk command transfer result=0
[133291.828736] Attempting to get CSW...
[133291.828738] xfer 13 bytes
[133291.828770] Status code 0; transferred 13/13
[133291.828772] -- transfer complete
[133291.828775] Bulk status result = 0
[133291.828779] Bulk Status S 0x53425355 T 0x7ed R 0 Stat 0x0
[133291.828782] scsi cmd done, result=0x0
[133291.828795] *** thread sleeping

I think that my issue is no support for mbr, because I am using uefi and I don't think I did anything for mbr.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 44921
Location: 56N 3W

PostPosted: Sat Jan 25, 2020 6:08 pm    Post subject: Reply with quote

quentin-k,

Code:
mount: /media/usb: special device /dev/sdb1 does not exist.

Yep. Your kernel can see /dev/sdb but not the partitions that it contains.

Try
Code:
mount -o ro,offset=18546688 -t auto /dev/sdb /media/usb

The filesystem will either be vfat or exfat, so you need vfat support and maybe exfat.
exfat is a FUSE filesystem. That's FUSE in the kernel and exfat tools and filesystem in user space.

Turn off all that USB debug/error reporting too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
quentin-k
n00b
n00b


Joined: 11 Jan 2020
Posts: 4

PostPosted: Sat Jan 25, 2020 7:13 pm    Post subject: Reply with quote

I have fixed the issue, I enabled support for msdos partitions in my kernel and it now works. Thanks for the help!
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