Sudden issues with USB flash drives

Getting your soundcard to work, using Debian on non-i386 hardware, etc

Sudden issues with USB flash drives

Postby scary-rob » 2018-07-02 12:48

I've recently bought a new computer and freshly installed Stretch XFCE from a 9.4+nonfree DVD. My previous PC had Stretch XFCE installed from a 9.2 disc. (64 bit architecture in both cases.) I did not encounter this problem on my previous computer.

Within the last week, I've encountered a problem with USB flash drives. Sometimes I plug one in and when I click on it in Thunar it mounts and shows me thumbnails for a split second before immediately unmounting. Yesterday, one of my flash drives mounted but when I right clicked in the Thunar window, options such as "create folder" were greyed-out.

As I've been transferring files on the occasions that these drives have managed to mount, I've been getting an error message:
Error creating directory [filepath]. Input/output error.


These flash drives have been mounting fine on my housemate's Windows 10 system (hopefully I won't get edited for swearing typing that :P ) and also on my laptop (HP Stream 13 running Fedora 28 XFCE). When I did manage to copy one folder of files to a flash drive yesterday, I got that same input/output error when I then tried to copy them from the flash drive to my Fedora laptop.

I've tried all three of my front-mounted USB sockets (2xUSB2 and 1xUSB3) and I'm getting the same results. I'm fairly certain this isn't an issue with their connection to the motherboard because I've got my wireless mouse dongle plugged into one of them and it's working absolutely fine.

Has anybody seen anything like this before?
scary-rob
 
Posts: 22
Joined: 2018-06-22 15:57

Re: Sudden issues with USB flash drives

Postby debiman » 2018-07-02 19:38

dirt in the usb socket?
User avatar
debiman
 
Posts: 2818
Joined: 2013-03-12 07:18

Re: Sudden issues with USB flash drives

Postby scary-rob » 2018-07-02 20:28

dirt in the usb socket?


Unlikely. BIOS is detecting the things fine and I'm having no issues with my wireless mouse (I've played some switchabouts between the front sockets to make sure).

Someone suggested that it might be a permissions issue, so I did the following to investigate:

I made a mount point using sudo (fdisk -l first to find the device ID). The result was:

Code: Select all
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.


So I tried dmesg | tail and the output was:

Code: Select all
[19325.848652] sdb: sdb1 [19325.849499] sd 4:0:0:0: [sdb] Attached SCSI removable disk [19394.251666] [UFW BLOCK] IN=wlp3s0 OUT= MAC=50:3e:aa:56:e6:1b:74:c2:46:a4:b2:3f:08:00 SRC=192.168.0.4 DST=192.168.0.7 LEN=345 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=49410 DPT=52636 LEN=325 [19395.604837] [UFW BLOCK] IN=wlp3s0 OUT= MAC=50:3e:aa:56:e6:1b:74:c2:46:a4:b2:3f:08:00 SRC=192.168.0.4 DST=192.168.0.7 LEN=345 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=49410 DPT=52636 LEN=325 [19396.504528] [UFW BLOCK] IN=wlp3s0 OUT= MAC=50:3e:aa:56:e6:1b:74:c2:46:a4:b2:3f:08:00 SRC=192.168.0.4 DST=192.168.0.7 LEN=345 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=49410 DPT=52636 LEN=325 [19397.636230] [UFW BLOCK] IN=wlp3s0 OUT= MAC=50:3e:aa:56:e6:1b:74:c2:46:a4:b2:3f:08:00 SRC=192.168.0.4 DST=192.168.0.7 LEN=345 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=49410 DPT=52636 LEN=325 [19513.857904] [UFW BLOCK] IN=wlp3s0 OUT= MAC=50:3e:aa:56:e6:1b:74:c2:46:a4:b2:3f:08:00 SRC=192.168.0.4 DST=192.168.0.7 LEN=345 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=49410 DPT=52380 LEN=325 [19515.905946] [UFW BLOCK] IN=wlp3s0 OUT= MAC=50:3e:aa:56:e6:1b:74:c2:46:a4:b2:3f:08:00 SRC=192.168.0.4 DST=192.168.0.7 LEN=345 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=49410 DPT=52380 LEN=325 [19516.725194] [UFW BLOCK] IN=wlp3s0 OUT= MAC=50:3e:aa:56:e6:1b:74:c2:46:a4:b2:3f:08:00 SRC=192.168.0.4 DST=192.168.0.7 LEN=345 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=49410 DPT=52380 LEN=325 [19517.749212] [UFW BLOCK] IN=wlp3s0 OUT= MAC=50:3e:aa:56:e6:1b:74:c2:46:a4:b2:3f:08:00 SRC=192.168.0.4 DST=192.168.0.7 LEN=345 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=49410 DPT=52380 LEN=325


I can't see anything helpful in there, but that may be my ignorance.

FWIW, my original poke with fdisk suggests the file system on the stick I was testing with was fat32.

The other party suggested I try

Code: Select all
fdisk -l && sudo fdisk /dev/sdb


By this point, however, my system had decided that it wasn't going to even partially detect the flash drive anymore, so even after unplugging and replugging it in, the output was:

Code: Select all
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disklabel type: gpt Disk identifier: 6DF21727-54BD-4243-A7C5-80D1D73CDD90

Device Start End Sectors Size Type /dev/sda1 2048 1050623 1048576 512M EFI System /dev/sda2 1050624 1550335 499712 244M Linux filesystem /dev/sda3 1550336 1953523711 1951973376 930.8G Linux LVM

Disk /dev/mapper/bedevere--vg-root: 922.8 GiB, 990870765568 bytes, 1935294464 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes

Disk /dev/mapper/bedevere--vg-swap_1: 8 GiB, 8535408640 bytes, 16670720 sectors Units: sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes

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

fdisk: cannot open /dev/sdb: No such file or directory


To make it clear: when I insert a USB drive, its LED turns on or blinks, but it may or may not show up in Thunar, and when it does, it unmounts within a minute. The LED remains on. Rebooting with the drive still in and going into the BIOS menu, the flash drive is clearly detected as it shows up in the boot menu (NB, this stick I was using for testing did not have an iso on it). I switched it with my mouse dongle and the mouse is working fine, and the flash drive is still not behaving right in the other USB port. I used only one flash drive for testing today, but the problems were occurring with three different flash drives on Sunday.

I first noticed something was amiss on Friday and the drives seem to be working properly on my Fedora machine. Which suggests that I've somehow done something to cause this. The only change I can remember making to the system before Friday was a failed attempt at installing a driver for a Brother wifi printer.

Tomorrow I may boot from my recovery DVD just to see what happens.
scary-rob
 
Posts: 22
Joined: 2018-06-22 15:57

Re: Sudden issues with USB flash drives

Postby bw123 » 2018-07-02 21:24

rob, don't run any commands off the internet.

Someone suggested that it might be a permissions issue, so I did the following to investigate: I made a mount point using sudo (fdisk -l first to find the device ID). The result was:
Code: Select all
 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.



funny, you left out the command you entered? you left out the dmesg | tail or so? except this "fdisk: cannot open /dev/sdb: No such file or directory" so you are runnig it with and without a usb inserted? ok then.

How would creating a new mount point solve a permissions issue?
User avatar
bw123
 
Posts: 3278
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Sudden issues with USB flash drives

Postby scary-rob » 2018-07-02 22:26

rob, don't run any commands off the internet.


The command was fdisk and I'd already run it once off my own back.

funny, you left out the command you entered?

How would creating a new mount point solve a permissions issue?


Right. Going back to the beginning of that bit:

Creating a mount point wasn't going to solve the issue, but running it as the super user should at least confirm or deny whether it's a permissions issue. I'm now fairly certain it's not a permissions issue.

So the commands I ran for this mountpoint began with sudo fdisk -l to identify what I was mounting (output identified my flash drive as /dev/sdb), then

Code: Select all
$ sudo mkdir /media/usb
$ sudo mount /dev/sdc /media/usb


That's when I got the error you quoted.

you left out the dmesg | tail or so?


No, dmesg | tail was what I input to get the string of MAC addresses and other things. I assumed from the way the error messaged phrased the suggestion that it meant choose between "tail" or "so". Was I supposed to input
Code: Select all
dmesg | tail or so
?

So when I ran those fdisk commands at the other party's suggestion, /dev/sdb was no longer being identified - it seems that my system had "lost" the drive again. And yes, the flash drive's LED was still on.

"fdisk: cannot open /dev/sdb: No such file or directory" so you are runnig it with and without a usb inserted? ok then.


Apparently my system thinks my flash drives are Shrodinger's cat.
scary-rob
 
Posts: 22
Joined: 2018-06-22 15:57

Re: Sudden issues with USB flash drives

Postby bw123 » 2018-07-02 22:38

ok it is tricky. Immediately after inserting a usb device, you can run
dmesg | tail
and find out what /dev/sd* node it is assigned from the dmesg output.

all you need from there is fdisk -l and it will show all devices, you don't need the "fdisk -l && sudo fdisk /dev/sdb" terminology, that is really kind of crazy.
User avatar
bw123
 
Posts: 3278
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Sudden issues with USB flash drives

Postby debiman » 2018-07-03 14:58

scary-rob wrote:
Code: Select all
$ sudo mkdir /media/usb
$ sudo mount /dev/sdc /media/usb


That's when I got the error you quoted.

don't use the /media directory for this, the system might not like it.
also you would typically mount a partition, not a whole drive:
mount /dev/sdc1
User avatar
debiman
 
Posts: 2818
Joined: 2013-03-12 07:18

Re: Sudden issues with USB flash drives

Postby scary-rob » 2018-07-04 21:24

So I tested this out booting from my install DVD and the result was that I was still getting the problem. So maybe it isn't a software issue. I also tried out my back USB ports (the ones that come with the mother board) and everything is working fine with those ones. So despite the mouse working I'm leaning towards this being some small flaw in the connection between the case USB ports and the motherboard, especially in the light of debiman's suggestion of dirt in the socket.
scary-rob
 
Posts: 22
Joined: 2018-06-22 15:57

Re: Sudden issues with USB flash drives

Postby debiman » 2018-07-05 10:37

no.

your error is very clear:

Code: Select all
sudo mount /dev/sdc


that's not how you do it.
the drive is partitioned. you cannot mount the whole drive, you have to choose a partition.
assuming you want the first partition:

Code: Select all
sudo mount /dev/sdc1


oh, and please use mount with -v option and show us the output.
User avatar
debiman
 
Posts: 2818
Joined: 2013-03-12 07:18

Re: Sudden issues with USB flash drives

Postby scary-rob » 2018-07-05 13:28

no.

your error is very clear:


That was a mistake in my tests, yes, but not the actual problem. However, here's the mount -v output you wanted. In went a flash drive, and I ran fdisk -l to make sure of what I was trying to mount. It gave me the following output:

Code: Select all
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: gpt
Disk identifier: 6DF21727-54BD-4243-A7C5-80D1D73CDD90

Device       Start        End    Sectors   Size Type
/dev/sda1     2048    1050623    1048576   512M EFI System
/dev/sda2  1050624    1550335     499712   244M Linux filesystem
/dev/sda3  1550336 1953523711 1951973376 930.8G Linux LVM




Disk /dev/mapper/bedevere--vg-root: 922.8 GiB, 990870765568 bytes, 1935294464 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mapper/bedevere--vg-swap_1: 8 GiB, 8535408640 bytes, 16670720 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/sdb: 123 MiB, 128974848 bytes, 251904 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: 0x00000000

Device     Boot Start    End Sectors  Size Id Type
/dev/sdb1  *       32 251903  251872  123M  6 FAT16


Then I ran
Code: Select all
sudo mount -v /dev/sdb1


and the result was:

Code: Select all
mount: can't find /dev/sdb1 in /etc/fstab
scary-rob
 
Posts: 22
Joined: 2018-06-22 15:57


Return to Hardware

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable