User Feedback :: PNY USB Attache 2G Drive



lucky13,
I just booted DSL 4.3 with the PNY 2 Gig inserted,
and there is no entry in /etc/fstab for /dev/sda,
only /dev/hda1 my WIN2K hard drive as I am
running off a LiveCD.

I'm ready when ever you are.  I don't have to back
up the PNY because there is nothing on it that I need.
Let's go, but be specific with your Terminal instructions.

Thanks.

lkraemer

Okay, first step. Read through this first.

Open a terminal and enter this (assuming it's the only USB device and would be detected at /dev/sda):
Code Sample
sudo cfdisk /dev/sda


If you get any errors and/or it fails to load, try this:
Code Sample
sudo cfdisk -z /dev/sda


This second one (with -z) will start with a zero partition table (edit: to clarify, that flag causes cfdisk to ignore any existing partition table and to overwrite it with a new one).

You should be able to set up the partition(s) on it now. You can allocate it all as one partition or however you want. Just remember that Windows is picky about the first partition on devices being FAT -- which should be moot if you're only using one partition and it's FAT. Set up at least one *primary* partition. If you're making only one, choose the whole disk (whatever number in MB it offer). When you have the partition(s) set up, you need to set the filesystem type (toggle the commands on bottom and use the "type" command). When it's set up the way you want, select "write." It will prompt you if you're sure you want to do write it. If it looks right, then go ahead and type "yes" (it requires full assent, not y or n). Once it confirms it's written the table you can safely exit. It will tell you that it's lacking a bootable partition; don't bother toggling it as bootable if you're not going to boot from it (even though it won't hurt if it's toggled bootable).

Next, you'll need to create the filesystem. Make sure the device isn't mounted (cat /etc/mtab); umount it if it's mounted. You'll use mkdosfs for this. I'm going to presume you're making one partition (sda1). If you set up the partition for FAT16, you should just need to use the command by itself (see below):
Code Sample
sudo mkdosfs /dev/sda1


If you want FAT32, you'll need to flag that:
Code Sample
sudo mkdosfs -F 32 /dev/sda1


(You can use the -F 16 flag to *make sure* you write FAT16.)

Then it should quickly give you another prompt. Double check your fstab entry to insure it's not set up for a different filesystem (and to see if hotplug has assigned a point without any further intervention). If you want to be safe, you can edit fstab so the filesystem is set to "auto."

You're looking for two lines in /etc/fstab like these (this is mine -- yours will be sda1 if it's the first USB device inserted):
Code Sample
# Added by KNOPPIX
/dev/sdb1 /mnt/sdb1 auto noauto,users,exec 0 0

in which "auto" could be listed as vfat, etc., instead. Go ahead and set it on auto if it isn't and cross your fingers.

Then try to mount (using the appropriate point for your device):
Code Sample
mount /mnt/sdb1


Hopefully you'll get a prompt quickly and be good to go. Don't forget to umount before removing the device.

---------------------

I just walked through this with a zip disk (mine are all ext2; used my USB zip drive) using the "cfdisk -z" and type=06 (FAT16) and then used "mkdosfs -F 16" to make sure DSL doesn't have any issues. This is the line from /etc/mtab showing how it's mounted:
/dev/sdb1 /mnt/sdb1 msdos rw,nosuid,nodev 0 0

Let me know if you need any clarification or if you run into any more problems.

edit: Just to make sure it correctly applies/handles FAT32 (I already know it does), I ran through the same process setting type=0B (Win95 FAT 32) in cfdisk and then used "mkdosfs -F 32". Remounted:
/dev/sdb1 /mnt/sdb1 vfat rw,nosuid,nodev 0 0

So I know it should work either way barring any strange quirks with your particular device.

lucky13,
I tried:
sudo cfdisk /dev/sda   and  sudo cfdisk -z /dev/sda
and both gave me the following error message.

FATAL ERROR: Cannot open disk drive
  Press any key to exit cfdisk

lsusb shows the device as:
Bus 001 Device 002:  ID 0930:653e Toshiba Corp.
and if I unplug it this entry goes away, so I know
for sure one and only one USB device is this one.

So, now I am lost again.  I just don't understand
why it shows up under lsusb but can't be accessed.
Is there another way to access it and remove the
partition and re-start the process you have just described?

Thanks for the additional information and help.

lkraemer

How long have you had this stick? Do you still have a receipt for it? Like I wrote previously, sometimes it comes down to the device being corrupt and other OSes (including other distros) have more "tolerance" for errors.

Worst case scenario, you just won't be able to use that with DSL but can with Ubuntu and whatever else it works with.

As a last ditch effort, you can try to zero out the partition table and then try cfdisk again but I have a hunch the problem is going to persist since cfdisk -z (which ignores whatever partition table may or may not be on it) was futile. But you never know -- maybe the problem is a really wacked out partition table the other distro can read but DSL can't.

If you want to try zeroing out manually, do this:
Code Sample
sudo dd if=/dev/zero of=/dev/sdX bs=512 count=1


(**** EDITED - where X is the node for the USB stick corrected per curaga's reminder.)

This literally zeroes out the partition table.

Then you'll have to try cfdisk again (either step above) and then go through the rest of the steps if it doesn't return another fatal error. If you can't get it to read under DSL, you should be able to repartition and create filesystem as you did before with Ubuntu, Windows, etc.

Two more things...

Try this before you zero anything out. Open a terminal. Enter:
Code Sample
sudo tail -f /var/log/messages

Then insert the device. Wait and several messages should print to screen. Copy all the events related to that back here. It may not be any more informative than what you've already pasted but maybe it will have something that can narrow it down to something unrelated to the device.

(You can ctrl-c to break tail after you get the events and remove the device.)

You can also enter "lsusb -v" with the device plugged in and see if there's anything else useful in the more verbose output.

Next Page...
original here.