分区:
#!/bin/sh
# partition size in MB
BOOT_ROM_SIZE=50
# call sfdisk to create partition table
# destroy the partition table
sudo dd if=/dev/zero of=/dev/sdb bs=1024 count=1
sudo sfdisk --force /dev/sdb << EOF
${BOOT_ROM_SIZE}M,1024M,83
1025M,,83
EOF
格式化:
sudo mkfs.ext4 /dev/sdb1