Need a USB Flash Drive Wizard

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

Need a USB Flash Drive Wizard

Postby dcihon » 2018-03-25 14:47

No matter what I have tried with dd gparted and whatever command I could find reference to on the internet I cannot get my flash drive to stop being read only.
Looks like I might have to trash the drive.

I will try anything at this point even clicking my heels together and say there's no place like home if that will help.
Looking for commands to try?

Lets start with some info:
Code: Select all
root@cihonm:~ # fdisk /dev/sdb

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

fdisk: cannot open /dev/sdb: Read-only file system
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18

Re: Need a USB Flash Drive Wizard

Postby Head_on_a_Stick » 2018-03-25 15:22

Code: Select all
# hdparm -R0 /dev/sdb
User avatar
Head_on_a_Stick
 
Posts: 7898
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Need a USB Flash Drive Wizard

Postby dcihon » 2018-03-25 15:30

1|root@cihonm:~ # hdparm -R0 /dev/sdb

/dev/sdb:
setting write-read-verify to 0
SG_IO: bad/missing sense data, sb[]: f0 00 05 00 00 00 00 0a 00 00 00 00 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SG_IO: bad/missing sense data, sb[]: f0 00 05 00 00 00 00 0a 00 00 00 00 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
write-read-verify = not supported


2|root@cihonm:~ # hdparm -I /dev/sdb

/dev/sdb:
SG_IO: bad/missing sense data, sb[]: f0 00 05 00 00 00 00 0a 00 00 00 00 26 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

ATA device, with non-removable media
Standards:
Likely used: 1
Configuration:
Logical max current
cylinders 0 0
heads 0 0
sectors/track 0 0
--
Logical/Physical Sector size: 512 bytes
device size with M = 1024*1024: 0 MBytes
device size with M = 1000*1000: 0 MBytes
cache/buffer size = unknown
Capabilities:
IORDY not likely
Cannot perform double-word IO
R/W multiple sector transfer: not supported
DMA: not supported
PIO: pio0
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18


Re: Need a USB Flash Drive Wizard

Postby dcihon » 2018-03-25 15:38

Sorry I am not going to use a ppa.

Here is more info:
Code: Select all
root@cihonm:~ # lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 009: ID 058f:6387 Alcor Micro Corp. Flash Drive
B
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18

Re: Need a USB Flash Drive Wizard

Postby Segfault » 2018-03-25 16:06

Mentioned mkusb seems to be merely a frontend for traditional command line tools.
Segfault
 
Posts: 700
Joined: 2005-09-24 12:24

Re: Need a USB Flash Drive Wizard

Postby dcihon » 2018-03-25 16:21

I installed it from Launchpad and it doesn't help either.

Edit:
Latest info:
Code: Select all
root@cihonm:~ # hdparm -r0 /dev/sdb                                                                                                                                 

/dev/sdb:
 setting readonly to 0 (off)
 readonly      =  0 (off)


Then:
Code: Select all
root@cihonm:~ # dd if=/dev/zero of=/dev/sdb
dd: failed to open '/dev/sdb': Read-only file system
1|root@cihonm:~ # dd if=/dev/sdb of=/dev/sdb                                                                                                                         
dd: failed to open '/dev/sdb': Read-only file system


Code: Select all
1|root@cihonm:~ # dmesg | tail
[11691.687094] usb 1-8.5: SerialNumber: 605933F7
[11691.689120] usb-storage 1-8.5:1.0: USB Mass Storage device detected
[11691.689304] scsi host4: usb-storage 1-8.5:1.0
[11692.713191] scsi 4:0:0:0: Direct-Access     Generic  Flash Disk       8.07 PQ: 0 ANSI: 4
[11692.714037] sd 4:0:0:0: Attached scsi generic sg2 type 0
[11692.714557] sd 4:0:0:0: [sdb] 122880000 512-byte logical blocks: (62.9 GB/58.6 GiB)
[11692.715254] sd 4:0:0:0: [sdb] Write Protect is off
[11692.715260] sd 4:0:0:0: [sdb] Mode Sense: 23 00 00 00
[11692.715953] sd 4:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[11692.723968] sd 4:0:0:0: [sdb] Attached SCSI removable disk


Code: Select all
root@cihonm:~ # fdisk /dev/sdb                                                                                                                                       

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

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x9c16c680.

Command (m for help):


Code: Select all
Command (m for help): d
No partition is defined yet!
Could not delete partition 94356203391129

Command (m for help): 1
1: unknown command

Command (m for help): d
No partition is defined yet!
Could not delete partition 94356203391129

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-122879999, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-122879999, default 122879999):

Created a new partition 1 of type 'Linux' and of size 58.6 GiB.

Command (m for help): w
fdisk: failed to write disklabel: Operation not permitted


I am right now trying some things with testdisk.
I will post here how it goes.
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18

Re: Need a USB Flash Drive Wizard

Postby llivv » 2018-03-26 16:45

what's the make?

have you looked on the manufactures site?

where you ever able to write to the drive?
in the kitchen with Julia
The Past, Christmas Present and Future
Get on the Dbus to Bcan
User avatar
llivv
 
Posts: 5614
Joined: 2007-02-14 18:10
Location: cold storage

Re: Need a USB Flash Drive Wizard

Postby Segfault » 2018-03-26 16:48

IMHO there are two possibilities, either the write protect switch is on (some USB drives have this switch) or the drive is dead. I have several flash storage devices gone bad like this.
Segfault
 
Posts: 700
Joined: 2005-09-24 12:24

Re: Need a USB Flash Drive Wizard

Postby Head_on_a_Stick » 2018-03-26 19:01

Segfault wrote:the drive is dead

^ This.
User avatar
Head_on_a_Stick
 
Posts: 7898
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Need a USB Flash Drive Wizard

Postby dcihon » 2018-03-27 10:20

There is no switch on this drive.

I started to use photorec and it was restoring files from the drive and then my / partition filled up so I had to fix that.

I will post back here my progress but I think the drive might have gone bad.
It did work up until Saturday. I was using a package called Meld and when I went to use the drive it stopped working. Not sure it that is a coincidence or not.
Thanks everyone for trying to help.
I have ordered a new drive.
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18

Re: Need a USB Flash Drive Wizard

Postby dcihon » 2018-03-30 23:58

So I thought I would post on update.
I have never used photrec before.
It was able to retrieve about 7,100 of the files on the flash drive. I had over 9,000 files on that drive.
So I don't know what happened to the drive and why I can't get it to work but most if not all the files are there.
photorec doesn't recover the file name but the content of the file is in tact with the correct file extension.

Not sure what I am going to do next.
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18

Re: Need a USB Flash Drive Wizard

Postby dcihon » 2018-04-03 10:27

Ok I bought a new drive.
Formated it with gparted.
Put some files on it.
I haven't done anything else.
I don't understand why I am getting these results from these commands:
Code: Select all
root@cihonm:~ # fsck /dev/sdb1
fsck from util-linux 2.31.1
e2fsck 1.44.1 (24-Mar-2018)
fsck.ext2: No such file or directory while trying to open /dev/sdb1
Possibly non-existent device?
8|root@cihonm:~ # fsck /dev/sdb1                                                                                                                                             
fsck from util-linux 2.31.1
fsck.fat 4.1 (2017-01-24)
0x41: Dirty bit is set. Fs was not properly unmounted and some data may be corrupt.
1) Remove dirty bit
2) No action
? 2
There are differences between boot sector and its backup.
This is mostly harmless. Differences: (offset:original/backup)
  65:01/00
1) Copy original to backup
2) Copy backup to original
3) No action
? 3
/dev/sdb1: 21 files, 1112/2047467 clusters
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18

Re: Need a USB Flash Drive Wizard

Postby bw123 » 2018-04-03 13:15

dcihon wrote:...I don't understand why I am getting these results from these commands:<snip>


I'm on stretch (util-linux 2.29.2-1) and still use FAT32 occasionally on usb or sdcard. The error about dirty bit is pretty common.

From what I can tell, it's caused by what it says, "Fs was not properly unmounted" and I have found that some devices, specifically microsd usb adapter has some issues when any block command like fdisk, fsck, or blkid is used on it. The device is fine with mount/read/write for hours or days, but the second I use any block command on it, the kernel burps and spams dmesg with "Driver Sense errors" and such until I remove the device, and reinsert.

So I have gotten in the habit of
# watch 'dmesg | tail'
when using the problematic device...
User avatar
bw123
 
Posts: 3278
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Need a USB Flash Drive Wizard

Postby dcihon » 2018-04-04 11:18

This is what it shows when I plug it in:
Code: Select all
root@cihonm:~ # dmesg | tail
[66757.664309] scsi host4: usb-storage 1-8.5:1.0
[66758.667401] scsi 4:0:0:0: Direct-Access     General  UDisk            5.00 PQ: 0 ANSI: 2
[66758.668087] sd 4:0:0:0: Attached scsi generic sg2 type 0
[66758.668330] sd 4:0:0:0: [sdb] 131072000 512-byte logical blocks: (67.1 GB/62.5 GiB)
[66758.668522] sd 4:0:0:0: [sdb] Write Protect is off
[66758.668527] sd 4:0:0:0: [sdb] Mode Sense: 0b 00 00 08
[66758.668729] sd 4:0:0:0: [sdb] No Caching mode page found
[66758.668738] sd 4:0:0:0: [sdb] Assuming drive cache: write through
[66758.670214]  sdb: sdb1
[66758.671307] sd 4:0:0:0: [sdb] Attached SCSI removable disk


The light on the USB drive is solid.
When I eject it the Device description changes from 67 GB Volume to General UDisk: 67 GB Volume and the light is flashing very rapidly. So it doesn't get fully ejected.
The only way I have found to fully eject it is after ejecting it from the file manager then open Disks and power it off. If I just take it out when it is flashing then it write protects it and I can't add or delete anything on it.
Should I buy a more expensive flash drive?
What I am going to use this flash drive for is listening to my mp3 files in my car.
dcihon
 
Posts: 233
Joined: 2012-09-23 16:18

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable