Page 1 of 3 123 LastLast
Results 1 to 10 of 27

Thread: How to force format a USB device?

  1. #1
    Join Date
    Apr 2009
    Beans
    33

    How to force format a USB device?

    Hi, my USB says it's write protected when I try to format it. Is there a way to force format it?

    It's a Sandisk Cruzer 8 GB drive with USB 2.0.

  2. #2
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to force format a USB device?

    Quote Originally Posted by manuganji View Post
    Hi, my USB says it's write protected when I try to format it. Is there a way to force format it?

    It's a Sandisk Cruzer 8 GB drive with USB 2.0.
    Hi ,
    Do you have windows ? if yes , then plugin the Usb stick and immediately
    right click and "Quick Format".
    This is one solution, as i assume that window's not properly disconnect of Usb-stick, is responsible for this.

    Or (from Ubuntu)
    you can try to correct filesystem with fsck tool.

    Plug in your usb-stick and open a terminal
    First give this command
    Code:
    sudo fdisk -l
    to see what is the dev name of the partition.
    We assume that is /dev/sdb1
    From terminal write
    Code:
    sudo umount /dev/sdb1 
    sudo fsck.vfat -f -p /dev/sdb1
    Thanks

  3. #3
    Join Date
    Aug 2007
    Location
    Canada
    Beans
    440
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to force format a USB device?

    Try with: palimpsest
    Best, Gnusci

    "Never make a calculation until you know the answer." -- Wheeler, Spacetime Physics, pg 60.

  4. #4
    Join Date
    Apr 2009
    Beans
    33

    Re: How to force format a USB device?

    Thanks for the quick replies. I tried formatting with disk utility. It failed with this error.
    Error creating partition table: helper exited with exit code 1: cannot open /dev/sdb: Read-only file system
    Tried the steps given by NikTh. This is what happened.

    manu@manu-Inspiron-N5010:~$ sudo fdisk -l
    [sudo] password for manu:

    Disk /dev/sda: 320.1 GB, 320072933376 bytes
    255 heads, 63 sectors/track, 38913 cylinders, total 625142448 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
    Disk identifier: 0x7429fb3c

    Device Boot Start End Blocks Id System
    /dev/sda1 2048 258047 128000 de Dell Utility
    /dev/sda2 * 258048 20004863 9873408 7 HPFS/NTFS/exFAT
    /dev/sda3 20004864 84598783 32296960 7 HPFS/NTFS/exFAT
    /dev/sda4 84600830 625141759 270270465 5 Extended
    /dev/sda5 84600832 294389759 104894464 7 HPFS/NTFS/exFAT
    /dev/sda6 294391808 479733759 92670976 7 HPFS/NTFS/exFAT
    /dev/sda7 479735808 582676479 51470336 7 HPFS/NTFS/exFAT
    /dev/sda8 582678528 613224447 15272960 83 Linux
    /dev/sda9 613226496 625141759 5957632 82 Linux swap / Solaris

    Disk /dev/sdb: 8004 MB, 8004304896 bytes
    247 heads, 62 sectors/track, 1020 cylinders, total 15633408 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
    Disk identifier: 0x000a9ca0

    Device Boot Start End Blocks Id System
    /dev/sdb1 62 15620279 7810109 c W95 FAT32 (LBA)
    manu@manu-Inspiron-N5010:~$ umount /dev/sdb1
    manu@manu-Inspiron-N5010:~$ fsck.vfat -f -p /dev/sdb1
    dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
    open: Permission denied
    manu@manu-Inspiron-N5010:~$ sudo fsck.vfat -f -p /dev/sdb1
    dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
    open: Read-only file system
    manu@manu-Inspiron-N5010:~$

  5. #5
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to force format a USB device?

    Hi ,
    please try these commands again , and give the results
    Code:
    sudo umount /dev/sdb1 
    sudo fsck.vfat -f -v /dev/sdb1
    Thanks

  6. #6
    Join Date
    Apr 2009
    Beans
    33

    Re: How to force format a USB device?

    Hi NikTh, these is the output I got. I didn't know which option to choose at that prompt to select 'which FAT?'. So, I tried both the options.

    manu@manu-Inspiron-N5010:~$ sudo fsck.vfat -f -v /dev/sdb1
    dosfsck 3.0.12 (29 Oct 2011)
    dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
    Checking we can access the last sector of the filesystem
    Boot sector contents:
    System ID "mkdosfs"
    Media byte 0xf8 (hard disk)
    512 bytes per logical sector
    4096 bytes per cluster
    32 reserved sectors
    First FAT starts at byte 16384 (sector 32)
    2 FATs, 32 bit entries
    7798784 bytes per FAT (= 15232 sectors)
    Root directory start at cluster 2 (arbitrary size)
    Data area starts at byte 15613952 (sector 30496)
    1948715 data clusters (7981936640 bytes)
    62 sectors/track, 247 heads
    0 hidden sectors
    15620218 sectors total
    FATs differ but appear to be intact. Use which FAT ?
    1) Use first FAT
    2) Use second FAT
    ? 1
    Reclaiming unconnected clusters.
    Checking free cluster summary.
    Leaving file system unchanged.
    /dev/sdb1: 4 files, 212206/1948715 clusters
    manu@manu-Inspiron-N5010:~$ sudo fsck.vfat -f -v /dev/sdb1
    dosfsck 3.0.12 (29 Oct 2011)
    dosfsck 3.0.12, 29 Oct 2011, FAT32, LFN
    Checking we can access the last sector of the filesystem
    Boot sector contents:
    System ID "mkdosfs"
    Media byte 0xf8 (hard disk)
    512 bytes per logical sector
    4096 bytes per cluster
    32 reserved sectors
    First FAT starts at byte 16384 (sector 32)
    2 FATs, 32 bit entries
    7798784 bytes per FAT (= 15232 sectors)
    Root directory start at cluster 2 (arbitrary size)
    Data area starts at byte 15613952 (sector 30496)
    1948715 data clusters (7981936640 bytes)
    62 sectors/track, 247 heads
    0 hidden sectors
    15620218 sectors total
    FATs differ but appear to be intact. Use which FAT ?
    1) Use first FAT
    2) Use second FAT
    ? 2
    Cluster 196606 out of range (78118970 > 1948716). Setting to EOF.
    Cluster 196609 out of range (4064259 > 1948716). Setting to EOF.
    Cluster 196612 out of range (6169609 > 1948716). Setting to EOF.
    Cluster 196616 out of range (16777215 > 1948716). Setting to EOF.
    Cluster 196620 out of range (23199743 > 1948716). Setting to EOF.
    Cluster 196624 out of range (12910591 > 1948716). Setting to EOF.
    Cluster 196627 out of range (31400841 > 1948716). Setting to EOF.
    Cluster 196629 out of range (268370507 > 1948716). Setting to EOF.
    Cluster 196631 out of range (31326464 > 1948716). Setting to EOF.
    Cluster 196633 out of range (268371614 > 1948716). Setting to EOF.
    Cluster 196635 out of range (41287936 > 1948716). Setting to EOF.
    Cluster 196637 out of range (268371615 > 1948716). Setting to EOF.
    Cluster 196639 out of range (96338176 > 1948716). Setting to EOF.
    Cluster 196641 out of range (268371616 > 1948716). Setting to EOF.
    Cluster 196643 out of range (5636865 > 1948716). Setting to EOF.
    Cluster 196646 out of range (142475392 > 1948716). Setting to EOF.
    Cluster 196648 out of range (268371617 > 1948716). Setting to EOF.
    Cluster 196650 out of range (51773952 > 1948716). Setting to EOF.
    Cluster 196653 out of range (111345858 > 1948716). Setting to EOF.
    Cluster 196655 out of range (16777226 > 1948716). Setting to EOF.
    Cluster 196657 out of range (111542464 > 1948716). Setting to EOF.
    Cluster 196659 out of range (16777226 > 1948716). Setting to EOF.
    Cluster 196661 out of range (111608128 > 1948716). Setting to EOF.
    Cluster 196663 out of range (67108874 > 1948716). Setting to EOF.
    Cluster 196665 out of range (25035136 > 1948716). Setting to EOF.
    Cluster 196668 out of range (75366912 > 1948716). Setting to EOF.
    Cluster 196670 out of range (268371624 > 1948716). Setting to EOF.
    Cluster 196672 out of range (22939419 > 1948716). Setting to EOF.
    Cluster 196675 out of range (42861312 > 1948716). Setting to EOF.
    Cluster 196678 out of range (70648704 > 1948716). Setting to EOF.
    Cluster 196681 out of range (106299398 > 1948716). Setting to EOF.
    Cluster 196683 out of range (268371631 > 1948716). Setting to EOF.
    Cluster 196685 out of range (155058688 > 1948716). Setting to EOF.
    Cluster 196688 out of range (113181824 > 1948716). Setting to EOF.
    Cluster 196690 out of range (33554441 > 1948716). Setting to EOF.
    Cluster 196692 out of range (140378310 > 1948716). Setting to EOF.
    Cluster 196694 out of range (268371648 > 1948716). Setting to EOF.
    Cluster 196696 out of range (29753856 > 1948716). Setting to EOF.
    Cluster 196699 out of range (113902784 > 1948716). Setting to EOF.
    Cluster 196701 out of range (67108873 > 1948716). Setting to EOF.
    Cluster 196703 out of range (102630656 > 1948716). Setting to EOF.
    Cluster 196706 out of range (128320896 > 1948716). Setting to EOF.
    Cluster 196708 out of range (268371659 > 1948716). Setting to EOF.
    Cluster 196710 out of range (41288192 > 1948716). Setting to EOF.
    Cluster 196713 out of range (114427456 > 1948716). Setting to EOF.
    Cluster 196715 out of range (16777225 > 1948716). Setting to EOF.
    Cluster 196717 out of range (114755200 > 1948716). Setting to EOF.
    Cluster 196719 out of range (16777234 > 1948716). Setting to EOF.
    Cluster 196721 out of range (146998976 > 1948716). Setting to EOF.
    Cluster 196723 out of range (87293963 > 1948716). Setting to EOF.
    Cluster 196725 out of range (129892610 > 1948716). Setting to EOF.
    Cluster 196728 out of range (137232520 > 1948716). Setting to EOF.
    Cluster 196731 out of range (148975491 > 1948716). Setting to EOF.
    Cluster 196733 out of range (50331657 > 1948716). Setting to EOF.
    /install_status.log
    Contains a free cluster (590893). Assuming EOF.
    Reclaiming unconnected clusters.
    Unable to create unique name
    manu@manu-Inspiron-N5010:~$

  7. #7
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to force format a USB device?

    So , what now ?
    Did fsck corrected the problem ?

    Unplug and plug in again Usb-stick and try to format it with Disk Utility .
    Do not just format , but follow this
    1)Umount it
    2)Delete (click delete )
    3)Add new.. (Fat)

    Thanks

  8. #8
    Join Date
    Apr 2009
    Beans
    33

    Re: How to force format a USB device?

    NikTh, thanks for the patient answers.

    On clicking delete partition, I get this error in disk utility -
    Error erasing: helper exited with exit code 1: In part_del_partition: device_file=/dev/sdb, offset=31744

  9. #9
    Join Date
    Feb 2012
    Location
    el_GR
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to force format a USB device?

    Hmm.. strange problem.
    Are you sure that Usb doesn't has any switch button , for write protect ON/OFF ?

    I don't know any other method .
    dd command of course it a way , but i am not sure if fix the problem or will make it worse.
    If you want to try dd (with your own risk) , post back .

    Edit: Unplug usb and plug in again , then open a terminal and write
    Code:
    dmesg | tail -n25
    post back the results.

    Also we can try to format Usb-stick with Fdisk. Post back if you want to try.
    Regards
    Last edited by NikTh; July 21st, 2012 at 08:47 AM. Reason: edit added

  10. #10
    Join Date
    Sep 2011
    Location
    Pennsylvania, U.S.A.
    Beans
    2,528
    Distro
    Ubuntu Development Release

    Re: How to force format a USB device?

    Good point about the hardware switch. Some of them are quite inconspicuous. If all else fails, would it be worthwhile to look at the USB drive with Gparted? Perhaps delete and recreate the partition then format?

Page 1 of 3 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •