在linux下面给sd卡分区,格式化是非常轻松的。
我安装的系统是ubuntu10.04。
sd卡插上之后,自动mount了。
所以,第一步,umount。
$sudo -i
输入自己的密码取得root权限。
# mount
可以看到最后一行的设备号
/dev/mmcblk0 on /media/60C5-3EC0 type vfat (rw,nosuid,nodev,uhelper=udisks,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,flush)
umount这个sd卡
# umount /dev/mmcblk0
下面上场的是fdisk工具。
# fdisk /dev/mmcblk0
fdisk命令都是非常简单的。
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
先p,看看sd卡的分区现状。 然后d,删除原分区 n,创建分区
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-62528, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-62528, default 62528): +1500M
t,指定分区类型,
Command (m for help): t
Selected partition 1
Hex code (type L to list codes): L
0 Empty 24 NEC DOS 81 Minix / old Lin bf Solaris
1 FAT12 39 Plan 9 82 Linux swap / So c1 DRDOS/sec (FAT-
2 XENIX root 3c PartitionMagic 83 Linux c4 DRDOS/sec (FAT-
3 XENIX usr 40 Venix 80286 84 OS/2 hidden C: c6 DRDOS/sec (FAT-
4 FAT16 |