Choose style:

Author Topic: usb drive won't format  (Read 2911 times)

0 Members and 1 Guest are viewing this topic.

Offline Reg

  • nOOb
  • *
  • Posts: 4
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 3
usb drive won't format
« on: August 04, 2015, 08:40:00 pm »
Got this 16 gig usb drive.  It's locked into read only and will not let me alter it in any way.  Tried using the disk utility in Peppermint 3.  Got the following msgs for various attempts at clearing this thing.  Any body have any ideas on how to clear it?

When plugging in the drive

Error mounting: mount exited with exit code 18: Error opening '/dev/sdc1': Read-only file system
Failed to mount '/dev/sdc1': Read-only file system

When trying to modify the partition


Error modifying partition: helper exited with exit code 1: In part_change_partition: device_file=/dev/sdc, start=1048576, new_start=1048576, new_size=15749021696, type=0x07
Entering MS-DOS parser (offset=0, size=15750070272)
MSDOS_MAGIC found
looking at part 0 (offset 1048576, size 15749021696, type 0x07)
new part entry
looking at part 1 (offset 0, size 0, type 0x00)
new part entry
looking at part 2 (offset 0, size 0, type 0x00)
new part entry
looking at part 3 (offset 0, size 0, type 0x00)
new part entry
Exiting MS-DOS parser
MSDOS partition table detected
containing partition table scheme = 0
Warning: Unable to open /dev/sdc read-write (Read-only file system).  /dev/sdc has been opened read-only.
got it
Warning: Unable to open /dev/sdc read-write (Read-only file system).  /dev/sdc has been opened read-only.
got disk
got partition
new_size=15749021696 but resulting size, 15748562944, smaller than requested
Error: Can't have a partition outside the disk!
changed partition to start=16384 size=15749595136
Warning: Unable to open /dev/sdc read-write (Read-only file system).  /dev/sdc has been opened read-only.
Error: Can't write to /dev/sdc, because it is opened read-only.
ped_disk_commit_to_dev() failed

When trying to delete the partiton

Error erasing: helper exited with exit code 1: In part_del_partition: device_file=/dev/sdc, offset=1048576
Entering MS-DOS parser (offset=0, size=15750070272)
MSDOS_MAGIC found
looking at part 0 (offset 1048576, size 15749021696, type 0x07)
new part entry
looking at part 1 (offset 0, size 0, type 0x00)
new part entry
looking at part 2 (offset 0, size 0, type 0x00)
new part entry
looking at part 3 (offset 0, size 0, type 0x00)
new part entry
Exiting MS-DOS parser
MSDOS partition table detected
Warning: Unable to open /dev/sdc read-write (Read-only file system).  /dev/sdc has been opened read-only.
got it
Warning: Unable to open /dev/sdc read-write (Read-only file system).  /dev/sdc has been opened read-only.
got disk
got partition - part->type=0
Warning: Unable to open /dev/sdc read-write (Read-only file system).  /dev/sdc has been opened read-only.
Error: Can't write to /dev/sdc, because it is opened read-only.
ped_disk_commit_to_dev() failed

Offline configX

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 17
  • New Forum User
    • View Profile
  • Peppermint version(s): Six
Re: usb drive won't format
« Reply #1 on: August 04, 2015, 08:59:49 pm »
Have you tried creating a new partition table in GParted? I've also found sometimes that safely removing the drive and plugging it back in can cure it.

Offline Reg

  • nOOb
  • *
  • Posts: 4
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 3
Re: usb drive won't format
« Reply #2 on: August 04, 2015, 09:25:56 pm »
Tried gparted, don't work.  Tried other versions of linux, windows and yosimite too.  Nothing will alter read only status of drive.

Offline configX

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 17
  • New Forum User
    • View Profile
  • Peppermint version(s): Six
Re: usb drive won't format
« Reply #3 on: August 04, 2015, 09:57:41 pm »
What errors do you get when running mkfs?

First determine which device and partition it is by running lsblk.

Then run:

Code: [Select]
sudo mkfs -t fat /dev/sdx1
change x to be whatever device letter you found in lsblk.

Offline Reg

  • nOOb
  • *
  • Posts: 4
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 3
Re: usb drive won't format
« Reply #4 on: August 04, 2015, 10:13:46 pm »
typed lsblk - got sdc as the drive (only one partition)

typed sudo mkfs -t fat /dev/sdc - got - mkfs.fat: No such file or directory

it is a ntfs partiton also
« Last Edit: August 04, 2015, 10:17:25 pm by Reg »

Offline configX

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 17
  • New Forum User
    • View Profile
  • Peppermint version(s): Six
Re: usb drive won't format
« Reply #5 on: August 04, 2015, 10:16:35 pm »
Interesting, I guess Peppermint 3 didn't have dosfstools. You'll need to install that first before running mkfs.

sudo apt-get install dosfstools

Offline Reg

  • nOOb
  • *
  • Posts: 4
  • Karma: 0
  • New Forum User
    • View Profile
  • Peppermint version(s): 3
Re: usb drive won't format
« Reply #6 on: August 04, 2015, 10:18:40 pm »
My bad, edited the post for reply to mkfs

Offline configX

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 17
  • New Forum User
    • View Profile
  • Peppermint version(s): Six
Re: usb drive won't format
« Reply #7 on: August 04, 2015, 10:24:37 pm »
Still seems like you're missing mkfs.fat.

What does it show when you run which mkfs.fat?

If you get nothing then I recommend trying to reinstall dosfstools.

Offline configX

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 17
  • New Forum User
    • View Profile
  • Peppermint version(s): Six
Re: usb drive won't format
« Reply #8 on: August 04, 2015, 10:26:43 pm »
Nevermind, scratch what I said - I see what happened. You didn't add 1 to the end of sdc.

Offline configX

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 17
  • New Forum User
    • View Profile
  • Peppermint version(s): Six
Re: usb drive won't format
« Reply #9 on: August 04, 2015, 10:36:27 pm »
Also, if formatting it to fat32 or ext4 doesn't work with mkfs then first try reinstalling ntfs-3g and mount the USB again.

Offline AndyInMokum

  • Global Moderator
  • Hero
  • *****
  • Posts: 4808
  • Karma: 1013
  • "Keep on Rockin' in the Free World"
    • View Profile
  • Peppermint version(s): PM 9 & PM 8 Respin-2 (64-bit)
Re: usb drive won't format
« Reply #10 on: August 05, 2015, 12:57:05 am »
Hi Reg, I don't understand why GParted isn't working  :-\.  Have you tried this.  Insert your USB thumbdrive into your computer.  Fire up GParted

Select your thumbdrive from the dropdown list located in the top right hand section of the GParted window. 

Right click on your device in main body of the GParted window.  Select unmount if necessary. 

From the taskbar, select: Device

In the small advisory window, from: Select new partition table type select from the dropdown menu msdos, (this is the default setting). 

Click on Apply.  Your device's image will now turn grey. 

From the taskbar, select: Partition > New

In the new window, select:
  • Create as: Primary
  • File system: FAT32
  • Label: "Optional"
Click on Add.  From the toolbar, click on: Apply All Operations, (located below: Partition in the taskbar). From the small advisory window, click on: Apply.  Let GParted do its thing, click on: Close.  Exit GParted and you're done  ;).
« Last Edit: August 05, 2015, 01:16:35 am by AndyInMokum »
Backup! Backup! Backup! If you're missing any of these -  you ain't Backed Up!
For my system info please L/click HERE.

Offline VinDSL

  • Global Moderator
  • Hero
  • *****
  • Posts: 5449
  • Karma: 957
  • Peppermint Mod
    • View Profile
  • Peppermint version(s): Developmental Builds
Re: usb drive won't format
« Reply #11 on: August 05, 2015, 07:08:49 am »
Try running fdisk against the sig0 partition table...

Example (picked at random):  http://techspalace.blogspot.com/2011/10/solved-invalid-partition-table-on.html

Offline PCNetSpec

  • Administrator
  • Hero
  • *****
  • Posts: 26305
  • Karma: 2855
  • "-rw-rw-rw-" .. The Number Of The Beast
    • View Profile
    • PCNetSpec
  • Peppermint version(s): Peppermint 10
Re: usb drive won't format
« Reply #12 on: August 05, 2015, 12:55:45 pm »
If you're trying to erase the drive, AndyInMokum's suggestion (unmount / create a new partition table / create new partition) will work .. if it doesn't, the stick is likely fubar.
WARNING: You are logged into reality as 'root' .. logging in as 'insane' is the only safe option.

Team Peppermint
PCNetSpec

Offline configX

  • Jr. Member
  • **
  • Posts: 45
  • Karma: 17
  • New Forum User
    • View Profile
  • Peppermint version(s): Six
Re: usb drive won't format
« Reply #13 on: August 05, 2015, 01:05:29 pm »
If you're trying to erase the drive, AndyInMokum's suggestion (unmount / create a new partition table / create new partition) will work .. if it doesn't, the stick is likely fubar.

I've experienced what Reg is experiencing before and even Gparted threw errors. I assumed he already tried creating a new table based on his first few replies which is why I suggested the command line method. ntfs-3g may solve it if it wasn't included by default in Peppermint 3.