1

How can I format an external USB drive? I have a Western Digital external usb which adds automatically a virtual read-only CD partition which prevented me to run the standard ways to format a disk.

I read more than 3 threads here and I tried:

  • Disks

    Output:

    Error creating file system: Command-line `parted --script "/dev/sdb" mktable msdos' exited with non-zero exit status 1: 
    Error: Input/output error during read on /dev/sdb
    Error: Input/output error during read on /dev/sdb
    Error: Input/output error during write on /dev/sdb
    Warning: Error fsyncing/closing /dev/sdb: Input/output error
    (udisks-error-quark, 0)
    
  • Gparted

    Output:

    Input/output error during read on /dev/sdb
    
  • dd sudo dd if=/dev/zero of=/dev/sdb

    Output:

    dd: writing to ‘/dev/sdb’: Input/output error
    

After some hours searching I found this tutorial which involves windows tools and it worked! I am happy about it but I would like to know a way to do the same only via Linux.

1
  • Please edit your question and explain what the original problem is. You should mention that WD adds this secret VCD partition if that's what you were trying to remove. I only understood the issue after reading the linked article but most people won't bother. All necessary information should be in the question itself
    – terdon
    Dec 25, 2015 at 14:08

2 Answers 2

4

You want to try the U3_tool for linux: http://u3-tool.sourceforge.net. Keep in mind it doesn't come with a guarantee, but it's worth a shot if you want linux only. Alternatively you could run Wine.

Quote from that page:

Overview

Tool for controlling USB flash devices that confirm to the U3 specifications. This program can control the following features:

  • Replacing of CD image
  • Changing of virtual CD allocated size and completely removing it
  • Enabling and disabling Security
  • Unlocking and changing password of secured U3 device
  • Obtainig various device information

WARNING: This Software is still alpha. Since the commands for controlling U3 devices aren't publicly available, we don't excatly know what we are doing. Although the application has been tested on a Sandisk Cruzer micro and a Verbatim Store 'N Go, it is not said that it won't stop other devices from working. The author is not responsible for any damage to your device.

Supported devices

In general all U3 USB flash devices should be supported.

A list of devices that are reported to work with this tool is available in the forum

Status

This program should be usable for day to day use. But beware that it is still under development.

Installation

Download the latest release from the Sourceforge project page, and follow the instructions provided in the package.

Usage

Examples:

Removing U3 cd partition, making it a ordanarry UFD, under MS Windows where e:\ is one of the U3 device drives. u3_tool.exe -p 0 E

Unlock secured data partition under Linux 2.6.20+ # ./u3_tool -u /dev/sg3 Replace /dev/sg3 with the scsi generic device associated with your device. The correct device can be deduced from the dmesg output.

Unlock secured data partition under Linux 2.4 using USB subsystem # modprobe -r usb-storage # ./u3_tool -u scan # modprobe usb-storage

Links

7
  • I tried wine already the firmware updater doesnt recognise usb ports thx for the feedback will try your solution too
    – partizanos
    Dec 25, 2015 at 14:39
  • u3.sandisk.com does not exist anymore i tried to follow the install intructions I got some errors. Thanks dor trying
    – partizanos
    Dec 25, 2015 at 14:58
  • What errors did you get?
    – Daniel
    Dec 25, 2015 at 21:24
  • with wine the firmware of the company couldnt find the usb with the u3 during installation procedure I had some compile errors when I tried to run the configure script.
    – partizanos
    Dec 26, 2015 at 0:34
  • /u3-tool-0.3 $ ./configure checking for a BSD-compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking for C compiler default output file name... configure: error: in /home/dimitris/Downloads/u3-tool-0.3': configure: error: C compiler cannot create executables See config.log' for more details.
    – partizanos
    Dec 26, 2015 at 0:35
0

Here is the way (you must download sg3_utils package)

dev=$(sg_scan |grep "My Book"|cut -d' ' -f 1)
cfg=$(sg_raw -r 12 $dev 1a 00 20 00 0C 00 02 2>&1|cut -d " " -f 7-19)
disvcd="$(echo $cfg|cut -d " " -f 2-9) 00 $(echo $cfg|cut -d " " -f 11-13)"
echo $disvcd |xxd -r -p|sg_raw -s 12 $dev 15 11 00 00 0C 00 01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .