LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   partition usb flash disk (https://www.linuxquestions.org/questions/linux-newbie-8/partition-usb-flash-disk-755832/)

vin_akleh 09-17-2009 03:22 AM

partition usb flash disk
 
i made 2 partitions using backtrack for my flash drive and i cant seem to restore it without partitions, need help
"bt ~ # fdisk -l

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

Device Boot Start End Blocks Id System
/dev/sda1 * 1 9 72261 83 Linux
/dev/sda2 10 134 1004062+ 82 Linux swap
/dev/sda3 135 1044 7309575 83 Linux

Disk /dev/sdb: 2097 MB, 2097152000 bytes
2 heads, 63 sectors/track, 32507 cylinders
Units = cylinders of 126 * 512 = 64512 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 1500 94468+ b W95 FAT32
/dev/sdb2 1501 2000 31500 83 Linux"

lutusp 09-17-2009 03:30 AM

Quote:

Originally Posted by vin_akleh (Post 3686589)
i made 2 partitions using backtrack for my flash drive and i cant seem to restore it without partitions, need help

Could you explain the problem you are having? Is the drive partitioned, or not partitioned? You say both.

vin_akleh 09-17-2009 03:35 AM

i think it is partitioned because windows cant see the other partition and it says that it is less than 2GB when in fact it is 2GB even, ubuntu can't mount that flash drive so i need to restore it because know it is useless to me.
thanks in advanced.

lutusp 09-17-2009 03:52 AM

Quote:

Originally Posted by vin_akleh (Post 3686606)
i think it is partitioned because windows cant see the other partition and it says that it is less than 2GB when in fact it is 2GB even, ubuntu can't mount that flash drive so i need to restore it because know it is useless to me.
thanks in advanced.

Please define "restored." Do you want to:

1. Recover data from the drive?
2. Make it bootable as a Linux installation?
3. Turn it into a Windows -formatted drive for temporary storage?
4. Erase it and start over?

Please ... say clearly what you want.

vin_akleh 09-17-2009 03:54 AM

Quote:

Originally Posted by lutusp (Post 3686621)
please define "restored." do you want to:

1. Recover data from the drive?
2. Make it bootable as a linux installation?
3. Turn it into a windows -formatted drive for temporary storage?
4. Erase it and start over?

Please ... Say clearly what you want.

i want to make it all 1 partition fat32 or ext2

vin_akleh 09-17-2009 02:22 PM

Quote:

Originally Posted by lutusp (Post 3686621)
Please define "restored." Do you want to:

1. Recover data from the drive?
2. Make it bootable as a Linux installation?
3. Turn it into a Windows -formatted drive for temporary storage?
4. Erase it and start over?

Please ... say clearly what you want.

all those questions and u dont have any answer!!!
any body can help???

j_jerry 09-17-2009 02:28 PM

vin_akleh,

As said above its not clear from your question, what you're trying to do.

Please explain it clearly and we'll try to help you

repo 09-17-2009 02:30 PM

Did you tried gparted to reformat the drive ?
If you plug the drive in windows, can't you reformat the drive?


Quote:

all those questions and u dont have any answer!!!
What if you answered the questions

vin_akleh 09-17-2009 02:48 PM

[QUOTE=repo;3687439]Did you tried gparted to reformat the drive ?
If you plug the drive in windows, can't you reformat the drive?

were can i fined gparted on backtrack or how to downlaod it??
when i plug it in windows it only sees the fat fromated partition and only formats that part.

j_jerry 09-17-2009 02:53 PM

In Windows xp goto Start > settings > control panel > Administrative settings > computer management > disk management , then select your flash disk you'd be able to see all of your partitions

repo 09-17-2009 02:53 PM

I would suggest to download the gparted live cd and boot from it.

http://gparted.sourceforge.net/livecd.php

vin_akleh 09-17-2009 04:02 PM

1- windows disk manager sees it but cant format it
2- gparted cant see it at all
3- gnome "Error opening /dev/sdb: Permission denied"
4- double clicking on the drive (ubuntu) "Unable to mount location - Can't mount file"
any other sudgestions??

lutusp 09-17-2009 04:17 PM

Quote:

Originally Posted by vin_akleh (Post 3687604)
1- windows disk manager sees it but cant format it
2- gparted cant see it at all
any other sudgestions??

From Linux, open a root shell. Plug in the USB stick. Then:

Code:

# fdisk -l
The above command will list available drives and partitions on drives. Be careful -- choose the device from the list that represents the drive you want to erase and format. If you have any doubt in your mind about which it is, unplug the USB device and see which entry disappears from the above listing.

Okay. Assuming you have correctly identified the device of interest (let's say for this example that it is /dev/sdg1), do this:

Code:

# fdisk /dev/sdg
Enter fdisk, remove the existing partitions and replace them with one big partition (this is what you want, yes?). Save your changes and exit fdisk.

Now:

Code:

# mkfs.vfat /dev/sdg1
The above command will create a VFAT filesystem on the one partition you created above.

It's been very difficult to figure out what you want to do, but this is my best guess. Remember that these actions cannot be undone.

vin_akleh 09-17-2009 04:37 PM

Quote:

Originally Posted by lutusp (Post 3687624)
Enter fdisk, remove the existing partitions and replace them with one big partition (this is what you want, yes?). Save your changes and exit fdisk.

fdisk -l :-
Code:

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfd62fd62

  Device Boot      Start        End      Blocks  Id  System
/dev/sda1  *          1      12971  104189526    7  HPFS/NTFS
/dev/sda2          12972      27283  114961140    f  W95 Ext'd (LBA)
/dev/sda3          27284      38913    93417975    7  HPFS/NTFS
/dev/sda5          12972      25942  104189526    7  HPFS/NTFS
/dev/sda6          25943      27283    10771551  83  Linux

Disk /dev/sdb: 2097 MB, 2097152000 bytes
65 heads, 62 sectors/track, 1016 cylinders
Units = cylinders of 4030 * 512 = 2063360 bytes
Disk identifier: 0xffffffff

Disk /dev/sdb doesn't contain a valid partition table
root@waleed-laptop:~# fdisk /dev/sdb
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0x4961decd.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

can u tell me what to do from there to make it one partition??
i think that the usb drive is sdb

lutusp 09-17-2009 05:27 PM

Quote:

Originally Posted by vin_akleh (Post 3687658)
fdisk -l :-
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xfd62fd62

Device Boot Start End Blocks Id System
/dev/sda1 * 1 12971 104189526 7 HPFS/NTFS
/dev/sda2 12972 27283 114961140 f W95 Ext'd (LBA)
/dev/sda3 27284 38913 93417975 7 HPFS/NTFS
/dev/sda5 12972 25942 104189526 7 HPFS/NTFS
/dev/sda6 25943 27283 10771551 83 Linux

[ snip ]

can u tell me what to do from there to make it one partition??

Sure! Here:

Code:

$ man fdisk
And here:

Partitioning with fdisk

And many other places.


All times are GMT -5. The time now is 03:15 AM.