LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   usb key partition table (https://www.linuxquestions.org/questions/linux-general-1/usb-key-partition-table-346014/)

guldo 07-23-2005 12:23 PM

usb key partition table
 
Hello.
I've been trying to make a usb key work with both windows xp and windows 98.
I couldn't. The key does not work.

So, eventually, I tried to rebuild its partition, using my Linux pc.
I first ran:
badblocks -vw /dev/sda
that finished successfully after some time.
Then I tried to run cfdisk, but:
Quote:

FATAL ERROR: Cannot get disk size
I tried parted, too:
Quote:

Error: Unable to open /dev/sda - unrecognized disk label.
I also tried to wipe it all out:
dd if=/dev/zero of=/dev/sda bs=1K count=1
but it didn't work; I mean, dd executed successfully, but the partition trouble is still there.

What's wrong?!?

Thanks.

nixcraft 07-24-2005 06:19 AM

try fdisk /dev/sda

guldo 07-24-2005 09:47 AM

Code:

# fdisk  /dev/sda
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.

You must set cylinders.
You can do this from the extra functions menu.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

Command (m for help): p

Disk /dev/sda: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

  Device Boot      Start        End      Blocks  Id  System

Command (m for help): n
You must set cylinders.
You can do this from the extra functions menu.

Command (m for help): q

What should I do next?

Thanks

nixcraft 07-24-2005 12:59 PM

Type x > Type m - to read help it will show you menu to setup the cylinders

guldo 07-24-2005 02:24 PM

Thank you for your reply, but my problem is: how should I guess the number of cylinders? I don't even know what a cylinder is...

jimdaworm 07-24-2005 03:10 PM

have you tried the key in another machine just to rule out that there is a hardware fault?

guldo 07-24-2005 03:42 PM

Quote:

Originally posted by jimdaworm
have you tried the key in another machine just to rule out that there is a hardware fault?
Yes, thanks.

Anyway, looking at cfdisk on a working disk:
Code:

Disk /dev/hde: 120.0 GB, 120034123776 bytes
16 heads, 63 sectors/track, 232581 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

So I see that 516096 bytes * 232581 cylinders = 120034123776 bytes
My usb key has a capacity of 256MB, that *should* be 268435456 bytes; so it's
512 * x * y = 268435456
like: 512 * 1008 * 232581 = 120034123776
am I right?
How could I know x (or y) ?

Thanks

guldo 07-26-2005 02:28 AM

:confused:


All times are GMT -5. The time now is 02:05 AM.