Fdisk
From Openmoko
m (→Partition Ratio) |
m (→Partition Ratio) |
||
Line 7: | Line 7: | ||
Depending on your demands or suggestions in manual, create the number of partitions you need | Depending on your demands or suggestions in manual, create the number of partitions you need | ||
− | == Partition Ratio == | + | == Partition Ratio SD Card == |
The following in the ratio 3 to 1 (e.g. 4000000 blocks): | The following in the ratio 3 to 1 (e.g. 4000000 blocks): | ||
* '''[http://www.win.tue.nl/~aeb/partitions/partition_types-1.html FAT32]''' (3/4 of total size of SD - e.g. blocks 1-3000000) | * '''[http://www.win.tue.nl/~aeb/partitions/partition_types-1.html FAT32]''' (3/4 of total size of SD - e.g. blocks 1-3000000) | ||
* '''[http://www.win.tue.nl/~aeb/partitions/partition_types-1.html EXT3]''' (1/4 of total size of SD - e.g. blocks 3000001-4000000) | * '''[http://www.win.tue.nl/~aeb/partitions/partition_types-1.html EXT3]''' (1/4 of total size of SD - e.g. blocks 3000001-4000000) | ||
+ | * Calculate Blocks for Swap with 256MB for 2GB Mirco-SD Card with 12000 | ||
+ | 256/2048 * 12000 = 1500 Blocks needed for Swap with size 256MB | ||
== Create Partions == | == Create Partions == |
Revision as of 12:05, 19 October 2010
On Linux Machine backup current data on Micro SD-Card before using fdisk. If SD-Card is located in /dev/sde use the following fdisk command:
fdisk /dev/sde
Contents |
Determine Device Name of SD Card
Replace /dev/sde by appropriate device name. df will help you to identify the device name and size of SD card. Use df to display all mounted storage devices:
sudo df
Depending on your demands or suggestions in manual, create the number of partitions you need
Partition Ratio SD Card
The following in the ratio 3 to 1 (e.g. 4000000 blocks):
- FAT32 (3/4 of total size of SD - e.g. blocks 1-3000000)
- EXT3 (1/4 of total size of SD - e.g. blocks 3000001-4000000)
- Calculate Blocks for Swap with 256MB for 2GB Mirco-SD Card with 12000
256/2048 * 12000 = 1500 Blocks needed for Swap with size 256MB
Create Partions
Use fdisk to create partitions:
sudo fdisk /dev/sde
- -> p Check partitions
- -> d -> 1 Delete Partition 1 (repeat for other existing partitions)
- -> n -> 1 -> New partition 1 (enter first and last sector)
- -> t -> 1 -> c Set c for FAT32 (LBA)
- -> a -> 1 Set boot flag for first partition
- -> n -> 2 -> New partition 2 (enter first and last sector)
- -> t -> 2 -> 83 Set type 83 for Linux partition
- -> w Write changes
- -> q quit fdisk
After fdisk operations, format both partitionss. If SD-Card is located in /dev/sde use the following commands (replace /dev/sde by appropriate device name:
# mkfs.vfat -v -n and-media -F 32 /dev/sde1 # mkfs.ext3 -v -L and-data /dev/sde2
If you are root you can remove sudo from the command.
Swap Partition
If you need a swap partition use partition type 82 for Linux Linux partition in fdisk.
-> t -> 2 -> 82 Set type 82 for Linux partition in fdisk
where 2 is the number of the swap partition (replace 2 with the appropriate partition number).