LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-15-2017, 10:05 AM   #1
marcelp1
Member
 
Registered: Nov 2010
Distribution: Debian
Posts: 35

Rep: Reputation: 1
Building a file system on Flash Drive with filesystem already on...


I have by mistake issued "sudo mkfs.exfat -n 128.ExFAT /dev/sdc" on my 128GB
flash drive, and not noticed that I have not deleted the NTFS file system that
was there and I wanted to replace with ExFAT.

Now the flash drive can not be formatted to anything else, nor can the partition be deleted,
it shows as FAT32 on Windows 7 PC and same on Linux, I can write files to it,
but can not deleted them ...
Plus on Linux, the drive will show as FAT32, when plugged in come up with files I have managed
to write to the flash drive and then disappear see below dmesg:

[ 4513.191693] usb 3-2: new SuperSpeed USB device number 3 using xhci_hcd
[ 4513.208082] usb 3-2: New USB device found, idVendor=0781, idProduct=cffa
[ 4513.208089] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 4513.208092] usb 3-2: Product: iXpand Flash Drive
[ 4513.208095] usb 3-2: Manufacturer: SanDisk
[ 4513.208097] usb 3-2: SerialNumber: SDF2F7A0A123
[ 4513.209269] usb-storage 3-2:1.0: USB Mass Storage device detected
[ 4513.209452] scsi6 : usb-storage 3-2:1.0
[ 4516.109274] scsi 6:0:0:0: Direct-Access iXpand Flash Drive PQ: 0 ANSI: 6
[ 4516.110101] sd 6:0:0:0: [sdc] 249736704 512-byte logical blocks: (127 GB/119 GiB)
[ 4516.110219] sd 6:0:0:0: Attached scsi generic sg3 type 0
[ 4516.110474] sd 6:0:0:0: [sdc] Write Protect is off
[ 4516.110481] sd 6:0:0:0: [sdc] Mode Sense: 23 00 00 00
[ 4516.110870] sd 6:0:0:0: [sdc] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 4516.119611] sdc:
[ 4516.120755] sd 6:0:0:0: [sdc] Attached SCSI removable disk
[ 4516.288494] FAT-fs (sdc): utf8 is not a recommended IO charset for FAT filesystems, filesystem will be case sensitive!
[ 4516.292935] FAT-fs (sdc): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[ 4582.005578] usb 3-2: reset SuperSpeed USB device number 3 using xhci_hcd
[ 4582.022002] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd00
[ 4582.022005] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd48
[ 4591.123779] usb 3-2: reset SuperSpeed USB device number 3 using xhci_hcd
[ 4591.140357] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd00
[ 4591.140364] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd48
[ 4595.111348] usb 3-2: reset SuperSpeed USB device number 3 using xhci_hcd
[ 4595.127867] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd00
[ 4595.127874] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd48
[ 4601.776241] usb 3-2: reset SuperSpeed USB device number 3 using xhci_hcd
[ 4601.792959] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd00
[ 4601.792968] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd48
[ 4610.115232] usb 3-2: reset SuperSpeed USB device number 3 using xhci_hcd
[ 4610.131781] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd00
[ 4610.131784] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd48
[ 4619.101512] usb 3-2: reset SuperSpeed USB device number 3 using xhci_hcd
[ 4619.117914] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd00
[ 4619.117917] xhci_hcd 0000:00:14.0: xHCI xhci_drop_endpoint called with disabled ep ffff8800a4e5dd48
[ 4619.118645] sd 6:0:0:0: [sdc] Unhandled error code
[ 4619.118647] sd 6:0:0:0: [sdc]
[ 4619.118648] Result: hostbyte=DID_ERROR driverbyte=DRIVER_OK
[ 4619.118649] sd 6:0:0:0: [sdc] CDB:
[ 4619.118650] Write(10): 2a 00 00 00 ee fe 00 00 01 00
[ 4619.118655] end_request: I/O error, dev sdc, sector 61182
[ 4619.118657] Buffer I/O error on device sdc, logical block 61182
[ 4619.118658] lost page write due to I/O error on sdc
[ 4624.151808] usb 3-2: USB disconnect, device number 3
[ 4649.480445] sd 6:0:0:0: [sdc] Unhandled error code
[ 4649.480452] sd 6:0:0:0: [sdc]
[ 4649.480455] Result: hostbyte=DID_NO_CONNECT driverbyte=DRIVER_OK
[ 4649.480458] sd 6:0:0:0: [sdc] CDB:
[ 4649.480459] Write(10): 2a 00 00 00 00 01 00 00 01 00
[ 4649.480470] end_request: I/O error, dev sdc, sector 1
[ 4649.480475] Buffer I/O error on device sdc, logical block 1
[ 4649.480478] lost page write due to I/O error on sdc
[ 4649.485620] VFS: busy inodes on changed media or resized disk sdc
[ 4649.724205] usb 3-2: new SuperSpeed USB device number 4 using xhci_hcd
[ 4649.744317] usb 3-2: device descriptor read/8, error -61
[ 4649.848015] usb 3-2: new SuperSpeed USB device number 4 using xhci_hcd
[ 4649.864208] usb 3-2: device descriptor read/8, error -61
[ 4650.159736] usb 3-2: new SuperSpeed USB device number 5 using xhci_hcd
[ 4650.175934] usb 3-2: device descriptor read/8, error -61
[ 4650.279544] usb 3-2: new SuperSpeed USB device number 5 using xhci_hcd
[ 4650.295732] usb 3-2: device descriptor read/8, error -61
[ 4650.591350] usb 3-2: new SuperSpeed USB device number 6 using xhci_hcd
[ 4650.607377] usb 3-2: device descriptor read/8, error -61
[ 4650.711099] usb 3-2: new SuperSpeed USB device number 6 using xhci_hcd
[ 4650.727282] usb 3-2: device descriptor read/8, error -61
[ 4651.022804] usb 3-2: new SuperSpeed USB device number 7 using xhci_hcd
[ 4651.038902] usb 3-2: device descriptor read/8, error -61
[ 4651.142614] usb 3-2: new SuperSpeed USB device number 7 using xhci_hcd
[ 4651.158794] usb 3-2: device descriptor read/8, error -61
[ 4651.286439] usb usb3-port2: unable to enumerate USB device
 
Old 05-15-2017, 11:00 AM   #2
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,353
Blog Entries: 13

Rep: Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411Reputation: 4411
By mistake you mean that as opposed to using sdc1 you didn't put a number on the drive?

You can use fdisk to remove all partitions, recreate partitions of the type you wish, and then re-issue the mkfs command correctly.

fdisk also requires sudo and there is help available once you enter fdisk.

Please just be sure you are accessing the correct drive letter. It's unclear whether or not this was your error.
 
Old 05-15-2017, 01:31 PM   #3
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 4,206

Rep: Reputation: Disabled
Sounds like you need to start from scratch, re partition, reformat the drive. So, zero out the MBR info by doing a
Code:
sudo dd if/dev/zero of=/dev/your-128-drive bs=1M count=2
That should allow you to create a new MBR with fdisk & repartition it.
 
Old 05-15-2017, 03:00 PM   #4
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,961

Rep: Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402
Guess you could try this. "Please run fsck."
 
Old 05-15-2017, 03:53 PM   #5
marcelp1
Member
 
Registered: Nov 2010
Distribution: Debian
Posts: 35

Original Poster
Rep: Reputation: 1
Any attempt to create any partitions on the flash drive ends up
loots of error messages in dmesg:

$ sudo fsck -vcck /dev/sdb
fsck from util-linux 2.25.2
e2fsck 1.42.12 (29-Aug-2014)
ext2fs_open2: Bad magic number in super-block
fsck.ext2: Superblock invalid, trying backup blocks...
fsck.ext2: Bad magic number in super-block while trying to open /dev/sdb

The superblock could not be read or does not describe a valid ext2/ext3/ext4
filesystem. If the device is valid and it really contains an ext2/ext3/ext4
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
or
e2fsck -b 32768 <device>

$ sudo dd if=/dev/zero of=/dev/sdb bs=1M count=2
2+0 records in
2+0 records out
2097152 bytes (2.1 MB) copied, 0.0091418 s, 229 MB/s

$ sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.25.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: Input/output error





[ 169.746220] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.746229] sd 5:0:0:0: [sdb]
[ 169.746233] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.746236] sd 5:0:0:0: [sdb]
[ 169.746239] Sense Key : Illegal Request [current]
[ 169.746245] sd 5:0:0:0: [sdb]
[ 169.746249] Add. Sense: Invalid command operation code
[ 169.746253] sd 5:0:0:0: [sdb] CDB:
[ 169.746255] Read(6): 08 00 08 00 08 00
[ 169.746265] end_request: critical target error, dev sdb, sector 2048
[ 169.746271] Buffer I/O error on device sdb, logical block 256
[ 169.746633] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.746641] sd 5:0:0:0: [sdb]
[ 169.746645] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.746648] sd 5:0:0:0: [sdb]
[ 169.746651] Sense Key : Illegal Request [current]
[ 169.746657] sd 5:0:0:0: [sdb]
[ 169.746661] Add. Sense: Invalid command operation code
[ 169.746665] sd 5:0:0:0: [sdb] CDB:
[ 169.746667] Read(6): 08 00 08 00 08 00
[ 169.746678] end_request: critical target error, dev sdb, sector 2048
[ 169.746683] Buffer I/O error on device sdb, logical block 256
[ 169.751804] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.751812] sd 5:0:0:0: [sdb]
[ 169.751815] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.751819] sd 5:0:0:0: [sdb]
[ 169.751822] Sense Key : Illegal Request [current]
[ 169.751827] sd 5:0:0:0: [sdb]
[ 169.751831] Add. Sense: Invalid command operation code
[ 169.751835] sd 5:0:0:0: [sdb] CDB:
[ 169.751838] Read(6): 08 00 00 00 08 00
[ 169.751848] end_request: critical target error, dev sdb, sector 0
[ 169.751854] Buffer I/O error on device sdb, logical block 0
[ 169.752183] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.752187] sd 5:0:0:0: [sdb]
[ 169.752190] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.752193] sd 5:0:0:0: [sdb]
[ 169.752195] Sense Key : Illegal Request [current]
[ 169.752199] sd 5:0:0:0: [sdb]
[ 169.752202] Add. Sense: Invalid command operation code
[ 169.752206] sd 5:0:0:0: [sdb] CDB:
[ 169.752207] Read(6): 08 00 00 00 08 00
[ 169.752216] end_request: critical target error, dev sdb, sector 0
[ 169.752219] Buffer I/O error on device sdb, logical block 0
[ 169.752550] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.752555] sd 5:0:0:0: [sdb]
[ 169.752557] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.752560] sd 5:0:0:0: [sdb]
[ 169.752562] Sense Key : Illegal Request [current]
[ 169.752566] sd 5:0:0:0: [sdb]
[ 169.752569] Add. Sense: Invalid command operation code
[ 169.752572] sd 5:0:0:0: [sdb] CDB:
[ 169.752574] Read(6): 08 00 00 00 08 00
[ 169.752582] end_request: critical target error, dev sdb, sector 0
[ 169.752586] Buffer I/O error on device sdb, logical block 0
[ 169.752905] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.752909] sd 5:0:0:0: [sdb]
[ 169.752912] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.752915] sd 5:0:0:0: [sdb]
[ 169.752917] Sense Key : Illegal Request [current]
[ 169.752921] sd 5:0:0:0: [sdb]
[ 169.752924] Add. Sense: Invalid command operation code
[ 169.752947] sd 5:0:0:0: [sdb] CDB:
[ 169.752962] Read(6): 08 00 00 00 08 00
[ 169.753062] end_request: critical target error, dev sdb, sector 0
[ 169.753073] Buffer I/O error on device sdb, logical block 0
[ 169.753189] ldm_validate_partition_table(): Disk read failed.
[ 169.753515] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.753520] sd 5:0:0:0: [sdb]
[ 169.753522] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.753525] sd 5:0:0:0: [sdb]
[ 169.753527] Sense Key : Illegal Request [current]
[ 169.753532] sd 5:0:0:0: [sdb]
[ 169.753535] Add. Sense: Invalid command operation code
[ 169.753538] sd 5:0:0:0: [sdb] CDB:
[ 169.753540] Read(6): 08 00 00 00 08 00
[ 169.753549] end_request: critical target error, dev sdb, sector 0
[ 169.753552] Buffer I/O error on device sdb, logical block 0
[ 169.753856] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.753863] sd 5:0:0:0: [sdb]
[ 169.753865] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.753868] sd 5:0:0:0: [sdb]
[ 169.753870] Sense Key : Illegal Request [current]
[ 169.753874] sd 5:0:0:0: [sdb]
[ 169.753877] Add. Sense: Invalid command operation code
[ 169.753880] sd 5:0:0:0: [sdb] CDB:
[ 169.753882] Read(6): 08 00 00 00 08 00
[ 169.753890] end_request: critical target error, dev sdb, sector 0
[ 169.753893] Buffer I/O error on device sdb, logical block 0
[ 169.754194] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.754198] sd 5:0:0:0: [sdb]
[ 169.754200] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.754203] sd 5:0:0:0: [sdb]
[ 169.754205] Sense Key : Illegal Request [current]
[ 169.754209] sd 5:0:0:0: [sdb]
[ 169.754212] Add. Sense: Invalid command operation code
[ 169.754215] sd 5:0:0:0: [sdb] CDB:
[ 169.754217] Read(6): 08 00 00 00 08 00
[ 169.754225] end_request: critical target error, dev sdb, sector 0
[ 169.754228] Buffer I/O error on device sdb, logical block 0
[ 169.754524] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.754528] sd 5:0:0:0: [sdb]
[ 169.754531] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.754533] sd 5:0:0:0: [sdb]
[ 169.754535] Sense Key : Illegal Request [current]
[ 169.754539] sd 5:0:0:0: [sdb]
[ 169.754542] Add. Sense: Invalid command operation code
[ 169.754546] sd 5:0:0:0: [sdb] CDB:
[ 169.754547] Read(6): 08 00 00 00 08 00
[ 169.754555] end_request: critical target error, dev sdb, sector 0
[ 169.754558] Buffer I/O error on device sdb, logical block 0
[ 169.754570] Dev sdb: unable to read RDB block 0
[ 169.754877] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.754883] sd 5:0:0:0: [sdb]
[ 169.754887] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.754892] sd 5:0:0:0: [sdb]
[ 169.754895] Sense Key : Illegal Request [current]
[ 169.754901] sd 5:0:0:0: [sdb]
[ 169.754906] Add. Sense: Invalid command operation code
[ 169.754913] sd 5:0:0:0: [sdb] CDB:
[ 169.754916] Read(6): 08 00 00 00 08 00
[ 169.755281] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.755286] sd 5:0:0:0: [sdb]
[ 169.755289] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.755292] sd 5:0:0:0: [sdb]
[ 169.755294] Sense Key : Illegal Request [current]
[ 169.755298] sd 5:0:0:0: [sdb]
[ 169.755302] Add. Sense: Invalid command operation code
[ 169.755305] sd 5:0:0:0: [sdb] CDB:
[ 169.755307] Read(6): 08 00 00 00 08 00
[ 169.755628] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.755635] sd 5:0:0:0: [sdb]
[ 169.755639] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.755645] sd 5:0:0:0: [sdb]
[ 169.755648] Sense Key : Illegal Request [current]
[ 169.755656] sd 5:0:0:0: [sdb]
[ 169.755661] Add. Sense: Invalid command operation code
[ 169.755667] sd 5:0:0:0: [sdb] CDB:
[ 169.755670] Read(6): 08 00 00 18 08 00
[ 169.756017] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.756024] sd 5:0:0:0: [sdb]
[ 169.756028] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.756034] sd 5:0:0:0: [sdb]
[ 169.756038] Sense Key : Illegal Request [current]
[ 169.756045] sd 5:0:0:0: [sdb]
[ 169.756050] Add. Sense: Invalid command operation code
[ 169.756056] sd 5:0:0:0: [sdb] CDB:
[ 169.756059] Read(6): 08 00 00 00 08 00
[ 169.756084] sdb: unable to read partition table
[ 169.763061] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.763071] sd 5:0:0:0: [sdb]
[ 169.763075] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.763080] sd 5:0:0:0: [sdb]
[ 169.763084] Sense Key : Illegal Request [current]
[ 169.763091] sd 5:0:0:0: [sdb]
[ 169.763096] Add. Sense: Invalid command operation code
[ 169.763101] sd 5:0:0:0: [sdb] CDB:
[ 169.763106] Read(6): 08 00 00 00 08 00
[ 169.763439] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.763445] sd 5:0:0:0: [sdb]
[ 169.763449] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.763454] sd 5:0:0:0: [sdb]
[ 169.763457] Sense Key : Illegal Request [current]
[ 169.763463] sd 5:0:0:0: [sdb]
[ 169.763467] Add. Sense: Invalid command operation code
[ 169.763471] sd 5:0:0:0: [sdb] CDB:
[ 169.763473] Read(6): 08 00 00 00 08 00
[ 169.767621] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.767625] sd 5:0:0:0: [sdb]
[ 169.767627] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.767629] sd 5:0:0:0: [sdb]
[ 169.767630] Sense Key : Illegal Request [current]
[ 169.767634] sd 5:0:0:0: [sdb]
[ 169.767636] Add. Sense: Invalid command operation code
[ 169.767638] sd 5:0:0:0: [sdb] CDB:
[ 169.767640] Read(6): 08 00 00 00 08 00
[ 169.767959] sd 5:0:0:0: [sdb] Invalid command failure
[ 169.767961] sd 5:0:0:0: [sdb]
[ 169.767963] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 169.767965] sd 5:0:0:0: [sdb]
[ 169.767966] Sense Key : Illegal Request [current]
[ 169.767969] sd 5:0:0:0: [sdb]
[ 169.767971] Add. Sense: Invalid command operation code
[ 169.767973] sd 5:0:0:0: [sdb] CDB:
[ 169.767974] Read(6): 08 00 00 00 08 00



@rtmistler: Sorry my bad, I have used the partition number it was then sdc1 .., I have managed to remove all the partitions from the drive using fdisk,
but can not create new partition .... is says Linux partition even if I select DOS partition ...
And then it will show "unknown" partition type in gnome-disk-utility

Checking now with fdisk and listing partitions I get this:

$ sudo fdisk /dev/sdb

Welcome to fdisk (util-linux 2.25.2).
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 0xd0fabe93.

Command (m for help): p
Disk /dev/sdb: 119.1 GiB, 127865192448 bytes, 249736704 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: 0xd0fabe93


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-249736703, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-249736703, default 249736703):

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

Command (m for help): p
Disk /dev/sdb: 119.1 GiB, 127865192448 bytes, 249736704 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: 0xd0fabe93

Device Boot Start End Sectors Size Id Type
/dev/sdb1 2048 249736703 249734656 119.1G 83 Linux


Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
/dev/sdb: close device failed: Input/output error

Last edited by marcelp1; 05-15-2017 at 04:12 PM.
 
Old 05-15-2017, 05:21 PM   #6
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
When a flash drive fails, it tends to fail to READ_ONLY. I have several SDHC cards in this state atm. They have the contents they have, you cannot delete anything. It's not a user error, driver error, or anything other than failed hardware. You can try to start over with the device. Backup first if you care about the contents.

# dcfldd if=/dev/zero of=/dev/sdb bs=1M
# cmp /dev/zero /dev/sdb

If the cmp doesn't fail at end of device, your writes didn't take. A good sign that the drive is done for. I've had a SDHC card fail with < 4 hours of usage. Just enough time to install a distro and watch about 2 hours of youtube, before... what's going on here???
 
Old 05-15-2017, 09:44 PM   #7
jefro
Moderator
 
Registered: Mar 2008
Posts: 20,961

Rep: Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402Reputation: 3402
I'm also leaning towards the failure of drive. Guess you could double check on different system to be sure. Try wipefs also just for grins.

Last edited by jefro; 05-16-2017 at 04:08 PM.
 
Old 05-16-2017, 06:55 AM   #8
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 601

Rep: Reputation: 172Reputation: 172
Many flash drives cannot be partitioned. They come with a single pseudo partition on them and any attempt at re-partitioning will fail and may ruin the drive.

The FORMAT of the file system does not require ANY re-partitioning. The two are seperate beasts and should not be confused.
 
Old 05-17-2017, 02:48 PM   #9
fatmac
Senior Member
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Posts: 4,206

Rep: Reputation: Disabled
Quote:
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0xd0fabe93.
You need to do as it says, before you can create any partitions on it!
(The command to do it is 'o'.)
Quote:
Command (m for help): m
Command action
a toggle bootable flag
b edit bsd disklabel
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
 
Old 05-18-2017, 11:31 AM   #10
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 17,393
Blog Entries: 10

Rep: Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212Reputation: 5212
Quote:
Originally Posted by dave@burn-it.co.uk View Post
Many flash drives cannot be partitioned. They come with a single pseudo partition on them and any attempt at re-partitioning will fail and may ruin the drive.
i have never heard of anything like it.
i went through my share of usb drives, and every single one of them could be reformatted to fat32, after e.g. having been used for a live system.
 
Old 05-18-2017, 01:55 PM   #11
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 601

Rep: Reputation: 172Reputation: 172
That is probably because formatting is a different thing to partitioning. I didn't say they couldn't be formatted I said that many come with a single "partition" and cannot be partitioned with more.
You can FORMAT that single "partition" to whatever file system you want.

Last edited by dave@burn-it.co.uk; 05-18-2017 at 01:58 PM.
 
Old 05-20-2017, 06:37 AM   #12
marcelp1
Member
 
Registered: Nov 2010
Distribution: Debian
Posts: 35

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by dave@burn-it.co.uk View Post
Many flash drives cannot be partitioned. They come with a single pseudo partition on them and any attempt at re-partitioning will fail and may ruin the drive.

The FORMAT of the file system does not require ANY re-partitioning. The two are seperate beasts and should not be confused.
Is there any "way" to spot those flash drives with "pseudo partition"?
Can you name any flash drives?

Well, I have first try to delete all partitions, then create 1, and then create file system, but on that drive it just looks it's not possible.
 
Old 05-20-2017, 07:00 AM   #13
dave@burn-it.co.uk
Member
 
Registered: Sep 2011
Distribution: Puppy
Posts: 601

Rep: Reputation: 172Reputation: 172
Quote:
Is there any "way" to spot those flash drives with "pseudo partition"?
Not without actually trying it.

Quote:
Can you name any flash drives?
It is often model dependant within a make.

I'm not trying to avoid being specific, it is just that it really is hit and miss.
I have even seen different size drives in the same model range behave differently, as well as different releases of the same drive.
 
Old 05-20-2017, 09:28 AM   #14
Shadow_7
Senior Member
 
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
I have a sandisk U3 stick (2GB) from long ago that gets "fresh" contents. But only if you plug it into a windows machine. You can delete that thing a million times, but plug it into a windows box and it magically shows up for your convenience. But that device was from over a decade ago and no device I've gotten since then does that. Except maybe the eMMC on my hp stream 11 with it's odd /dev/mmcblk0boot0 and /dev/mmcblk0boot1 that persist even if I $(dd if=/dev/zero of=/dev/mmcblk0) a million times. Otherwise all my usb sticks and SDHC cards (that still work) take the /dev/zero backhand like they should.
 
Old 05-20-2017, 10:54 PM   #15
ChristianC123
LQ Newbie
 
Registered: May 2017
Posts: 2

Rep: Reputation: Disabled
New partition

Code:
sudo dd if/dev/zero of=/dev/your-128-drive bs=1M count=2
This should allow you to create a new MBR with fdisk & repartition it.


Christian
Network Admin
http://cloudappsportal.com/

Last edited by ChristianC123; 05-20-2017 at 10:58 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change a flash drive to ntfs file system? bscho Linux - Hardware 3 09-07-2015 01:15 PM
Query about hard disk's file system & pen drive's filesystem bloodstreetboy Linux - Newbie 7 03-26-2013 12:38 AM
make an encrypt file system on a flash drive abashasan Linux - Newbie 3 03-07-2013 03:27 PM
USB Flash Drive, write protect, and flash file system questions storkus Linux - Hardware 4 12-01-2008 04:32 AM
DISCUSSION: Virtual Filesystem: Building a Linux Filesystem from an Ordinary File mchirico LinuxAnswers Discussion 0 10-28-2004 10:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration