LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Multi partition USB key - unable to format partitions (https://www.linuxquestions.org/questions/linux-general-1/multi-partition-usb-key-unable-to-format-partitions-860038/)

jorgehumberto 02-01-2011 10:46 AM

Multi partition USB key - unable to format partitions
 
Hi,

I am trying to create a multi-partition USB key to use to kick multiple OS's whenever I need (1 NTFS partition for Windows image and data storage, one ext3 for boot, another ext3 for Linux distros iso storage and the last one as a Fedora live usb with permanent storage).

I am using a Kingston Data Traveler G2 16GB usb key and I have absolutely no problem to create the partitions and all looks fine. The problem I encounter is that although I can format the 1st partition on the usd key to any fs I want, I am unable to do the same on the other partitions. I tried fdisk+mkfs.XXX (ext2, ext3, fat, vfat, ntfs) and gparted, and no luck.

mkfs.XXX gives me no errors when I run it but when I try to mount the partition in Fedora 14 the OS is unable detect the fs. Gparted allows me to format the fs, gives no errors, shows a format successful message, but when it re-scans the device the fs appears as unknown.

I know it is possible to do this as I had a DataTraveler 101 16GB and it was working fine until I lost it.

Has anyone encountered a problem like that? Any ideas?

I googled around but couldntt find anything... :(

Thanks in advance!
Jorge

BoraxMan 02-02-2011 02:04 AM

I have had a similar issue where a USB key would work periodically. I think the key itself was defective. The partition table is stored at the beginning of the key, and if this isn't reading correctly, it can affect the partitions that are on it.

You should check the entire USB key for error

Try this one, though it is a windows program
http://www.raymond.cc/blog/archives/...b-flash-drive/
or this one
http://www.blogsdna.com/5086/usb-dri...or-defects.htm

alternatively, you can just run

badblocks -v /dev/sdX

Do not run it on a partition, run it on the device
ie
badblocks -v /dev/sdb
NOT
badblocks -v /dev/sdb1
This will check the parition table.

See how you go. If this picks up defects, then you know your issue.

jorgehumberto 02-02-2011 11:08 AM

Hi BoraxMan

I tried that and here's the result:

Quote:

[root@spica ~]# badblocks -v /dev/sdb
Checking blocks 0 to 16383999
Checking for bad blocks (read-only test): done
Pass completed, 0 bad blocks found.

funny thing: I have no problems with only one partition...

Thanks for the tip anyway. :)

JZL240I-U 02-22-2011 04:08 AM

Does fdisk still find the partitions and their types? Did you choose primary or extended partition?

jorgehumberto 02-23-2011 02:24 AM

Quote:

Originally Posted by JZL240I-U (Post 4267119)
Does fdisk still find the partitions and their types? Did you choose primary or extended partition?

Yep, I tried with both extended and primary and same problem. Funny thing: I tried once and managed to create 2 small partitions and could see them both, but when I deleted them and tried again I got the same problem.

I am thinking it might be something wrong with the usb stick itself as a few days ago I created a full disk FAT32 partition, copied some data into it (in Windows) and after returning from holidays could not read the data either in Linux of Windows. (despite showing no bad blocks or any problem)

Anyway, I found my original USB disk which works, so I am gonna close this.

Thanks for the help!!!

JZL240I-U 02-23-2011 03:21 AM

Even if it is not anymore pressing: What does fdisk -l /dev/<stick> tell us?

jorgehumberto 02-24-2011 01:29 AM

Quote:

Originally Posted by JZL240I-U (Post 4268257)
Even if it is not anymore pressing: What does fdisk -l /dev/<stick> tell us?

I do not have the stick with me, but I remember it would not say anything unusual, would list the partitions normally with no problem at all. The problems appear when I try to format the file system...

JZL240I-U 02-24-2011 01:34 AM

Hmm. The partition information resides in bytes 446 - 512 of the MBR. You might extract that (e.g. with dd) and hand it to an hex editor, same as with the beginnings of the partitions. I don't doubt that one could find the meaning of those data in the net but I don't have any links handy :(. The partition types were okay (83 for linux AFAIR)?

jorgehumberto 03-16-2011 04:34 AM

Hi JZL240I-U,


Unfortunately can no longer test it, I just binned the usb stick as it was not working. Every time I copied data into it, it would appear that all was good, but when unplugging it from the computer and connecting back some data would disappear and the one that did not would be corrupted (tried both linux and windows)

Anyway, just found my old usb stick and recreated the multi partition disk and it works flawlessly. :)

thanks!!
Jorge


All times are GMT -5. The time now is 11:55 PM.