分区 [root@iZ237quifj8Z ~]# fdisk /dev/xvdb Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite) WARNING: DOS-compatible mode is deprecated. It's strongly recommended to Command (m for help): p Disk /dev/xvdb: 107.4 GB, 107374182400 bytes Device Boot Start End Blocks Id System Command (m for help): n Command (m for help): p Disk /dev/xvdb: 107.4 GB, 107374182400 bytes Device Boot Start End Blocks Id System Command (m for help): w Calling ioctl() to re-read partition table. |
格式化成ext4的文件系统 [root@iZ237quifj8Z ~]# mkfs.ext4 /dev/xvdb1 Writing inode tables: done This filesystem will be automatically checked every 20 mounts or 180 days, whichever comes first. Use tune2fs -c or -i to override. |
挂载 ##要永久挂载写入/etc/fstab vim /etc/fstab UUID=b894fd2c-454e-4c84-993e-17c25766813f / ext4 defaults 1 1 /dev/xvdb1 /mnt ext4 defaults 0 0 ##可使用 :.!blkid /dev/xvdb1 可显示UUID ##不用重启,系统读取fstab文件,并生效 mount -a |