Your Ad Here

Saturday, May 12, 2007

Partitioning the removable USB Drive-HOW TO

I had tried to create partitions in my USB Flash Drive. My drive was of 32MB as the manufactures rating. All was well when I started GParted to created the partions. What I did was,

* I first selected the device /dev/sdb1 from File->Devices.I was really excited to get the device
/dev/sdb there.

* I do not remember what was the size of my drive before I did all the works below. But I remember I used to store some around 29MB data or more previously. I only know that it was a 32MB USB Drive.

* I deleted the partition, tried to create partiotions,etc and there were errors due to the drive being a 32MB one, coz fat32 required minimum 32MB disk space for creating a partion. I accepted that.

* The major problem that I had is after I tried to resolve the errors. What I did was - I deleted all the partitions and created just one .To my surprise, I found only 23MB space remained, and I could not create a FAT32 Partion.

*** WHAT THE HELL OUT WAS GOING THERE, I COULD NOT UNDERSTAND *****

But I am sure that the size initially was 32MB because it was the minimum requirement for FAT32 partion. Could not believe what was going there. I mounted the 23MB anyway, and viewed the properties from the GUI browser. Again, the same thing repeated.

Then I did this again...

* I started the command-line partion manipulation program "parted" which is the command-line tool for GParted.
* I selected the device /dev/sdb1 as
(parted) select /dev/sdb
* I printed the disk information
(parted) print
To my surprise, the output was ...
Disk geometry for /dev/sdb: 0kB - 32 MB

***** What is this again ? *****

* I created a partition as below ...

(parted) mkpart /dev/sda1
Partition type? primary/extended? primary
File system type? [ext2]?
Start?
Start?
Start? 1
End? 32
* Again I printed the partiotions as ...

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 1kB 32MB 32MB primary fat16
* This was **** OK! ****
But again I could not create a FAT32 partion

(parted) mkfs
Partition number? 1
File system? [ext2]? fat32
Error: Partition too big/small for a fat32 file system.

(parted)
* Then at the GParted now ...
Partition Filesystem Size Used Unused Flags
/dev/sdv1 /!\ []unknown 30.75 MiB - -

****** Lets try to create more partiontions then *****

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags

(parted) mkpart
Partition type? primary/extended? primary
File system type? [ext2]?
Start? 1
End? 16

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 32kB 16MB 16MB primary

(parted) mkfs
Partition number? 1
File system? [ext2]? fat16
Error: Partition too big/small for a fat16 file system.

(parted) rm 1

(parted) mkpart 1
Partition type? primary/extended? primary
File system type? [ext2]? fat16
Start? 1
End? 17

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 32kB 16MB 16MB primary

(parted) mkpart
Partition type? primary/extended? extended
Start? 16
End?
End? 32

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 32kB 16MB 16MB primary
2 16MB 32MB 16MB extended

(parted) mkfs
Partition number? 1
File system? [ext2]? fat16
Error: Partition too big/small for a fat16 file system.

(parted) mkfs
Partition number? 1
File system? [ext2]?

(parted) mkfs
Partition number? 2
File system? [ext2]?

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 32kB 16MB 16MB primary ext2
2 16MB 32MB 16MB extended

(parted)

***** Lets Do someting more again ************

(parted) mkfs
Partition number? 2
File system? [ext2]? fat16
Error: Partition too big/small for a fat16 file system.

(parted) mkfs
Partition number? 2
File system? [ext2]? ext2

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 32kB 16MB 16MB primary ext2
2 16MB 32MB 16MB extended

(parted) mkpart
Partition type? primary/logical? extended
Partition type? primary/logical? logical
File system type? [ext2]?
Start? 16MB
End? 32MB

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 32kB 16MB 16MB primary ext2
2 16MB 32MB 16MB extended
5 16MB 32MB 16MB logical

(parted) mkfs
Partition number? 54
Error: Partition doesn't exist.

(parted) mkfs
Partition number? 5
File system? [ext2]? fat16
Error: Partition too big/small for a fat16 file system.

(parted) mkfs
Partition number? ext2
Error: Expecting a partition number.

(parted) mkfs
Partition number? 5
File system? [ext2]? ext2

(parted) rm 1
Error: Partition /dev/sdb1 is being used. You must unmount it before you modify it with Parted.

(parted) rm 1

(parted) rm 5
Error: Partition /dev/sdb5 is being used. You must unmount it before you modify it with Parted.

(parted) rm 5

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
2 16MB 32MB 16MB extended

(parted) rm 2

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags

(parted) mkpart
Partition type? primary/extended? primary
File system type? [ext2]? fat16
Start? 1MB
End? 18MB

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 1kB 18MB 18MB primary

(parted) mkpart
Partition type? primary/extended? extended
Start? 18MB
End? 32MB

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 1kB 18MB 18MB primary
2 18MB 32MB 14MB extended

(parted) mkfs
Partition number? 1
Error: Partition /dev/sdb1 is being used. You must unmount it before you modify it with Parted.

(parted) mkfs
Partition number? 1
File system? [ext2]? fat16

(parted) mkpart
mkpart mkpartfs

(parted) mkpart
Partition type? primary/logical? logical
File system type? [ext2]? ext2
Start? 18MB
End? 32MB

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 1kB 18MB 18MB primary fat16
2 18MB 32MB 14MB extended
5 18MB 32MB 14MB logical

(parted) mkfs 5
File system? [ext2]? ext2

(parted) print
Disk geometry for /dev/sdb: 0kB - 32MB
Disk label type: msdos
Number Start End Size Type File system Flags
1 1kB 18MB 18MB primary fat16
2 18MB 32MB 14MB extended
5 18MB 32MB 14MB logical ext2
(parted)


****** Following commands are available for (parted) ***
(parted) help
check NUMBER do a simple check on the file system
cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER copy file system to another partition
help [COMMAND] prints general help, or help on COMMAND
mklabel LABEL-TYPE create a new disklabel (partition table)
mkfs NUMBER FS-TYPE make a FS-TYPE file system on partititon NUMBER
mkpart PART-TYPE [FS-TYPE] START END make a partition
mkpartfs PART-TYPE FS-TYPE START END make a partition with a file system
move NUMBER START END move partition NUMBER
name NUMBER NAME name partition NUMBER as NAME
print [NUMBER] display the partition table, or a partition
quit exit program
rescue START END rescue a lost partition near START and END
resize NUMBER START END resize partition NUMBER and its file system
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
set NUMBER FLAG STATE change a flag on partition NUMBER
unit UNIT set the default unit to UNIT
(parted)


**** I AM PRETTY MUCH SURE THESE ALL WILL HELP IF YOU ARE NOVICE THAN ME
or ARE MORE CONCERNED TO DEBUG, CONTRIBUTE TO THE OPEN SOURCE *****

By, ACP Masquerade [ 2007-05-12 22:30 NPT (GMT+5:45) ]

Also Available here

No comments: