Changes will remain in memory only, until you decide to write them. Be careful before using the write command.
Device does not contain a recognized partition table Building a new DOS disklabel with disk identifier 0xc8b440ba.
Command (m forhelp): n Partition type: p primary (0 primary, 0 extended, 4 free) e extended Select (default p): p Partition number (1-4, default 1): 1 First sector (2048-41943039, default 2048): Using default value 2048 Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): Using default value 41943039 Partition 1 of type Linux and of size 20 GiB is set
Command (m forhelp): w The partition table has been altered!
Calling ioctl() to re-read partition table. Syncing disks.
格式化磁盘并写入文件系统
这里可以用ext3,也可以用ext4
1
mkfs.ext4 /dev/vdb1
创建挂载根目录下的data
1 2 3 4
mkdir /data chmod -R 777 /data # 应该挂载到根目录 data 下 mount /dev/vdb1 /data