In a Linux system, you can use FDISK to partition the hard disk, but to manually execute a lot of commands, it is cumbersome to use, and now remember that a script with Fdisk is automatically executed.
1 #make Partition2Ddif=/dev/zero OF=/DEV/MMCBLK1 bs=1024x768Count=1024x768 3FDISK/DEV/MMCBLK1 <<EOF4 N5 P6 1 7 2048 8+100M9 NTen P One 2 A - - T the 1 - C - a - 1 + W -Eof
The words of my hard drive are/DEV/MMCBL1K1
First erase the partition table,
Then use the Fdisk command to repartition him.
Here's a little command, << EOF.
This command keeps the command that is about to jump to another shell terminal to continue running in this terminal.
The end of the logo is EOF
The two empty lines in the middle represent the carriage return, the default meaning.
1 umount/dev/mmcblk1p1 2 /dev/ mmcblk1p13 umount/ dev/mmcblk1p2 4 mkfs.ext3/dev/mmcblk1p2
The following is a format for him, the format is finished to write data.
To partition a hard disk using Shell scripting Automation