挂载硬盘
[root@qz-13-208 ~]# fdisk /dev/sdsda sda1 sda2 sda3 sda4 sda5 sda6 sdb
[root@qz-13-208 ~]# fdisk /dev/sdb欢迎使用 fdisk (util-linux 2.23.2)。更改将停留在内存中,直到您决定将更改写入磁盘。使用写入命令前请三思。Device does not contain a recognized partition table使用磁盘标识符 0x31284959 创建新的 DOS 磁盘标签。命令(输入 m 获取帮助):m命令操作 a toggle a bootable flag b edit bsd disklabel c toggle the dos compatibility flag d delete a partition g create a new empty GPT partition table G create an IRIX (SGI) partition table 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)命令(输入 m 获取帮助):nPartition type: p primary (0 primary, 0 extended, 4 free) e extendedSelect (default p): p分区号 (1-4,默认 1):1起始 扇区 (2048-104857599,默认为 2048):将使用默认值 2048Last 扇区, +扇区 or +size{K,M,G} (2048-104857599,默认为 104857599):将使用默认值 104857599分区 1 已设置为 Linux 类型,大小设为 50 GiB命令(输入 m 获取帮助):wThe partition table has been altered!Calling ioctl() to re-read partition table.正在同步磁盘。
[root@qz-13-208 ~]# fdisk -l磁盘 /dev/sda:107.4 GB, 107374182400 字节,209715200 个扇区Units = 扇区 of 1 * 512 = 512 bytes扇区大小(逻辑/物理):512 字节 / 512 字节I/O 大小(最小/最佳):512 字节 / 512 字节磁盘标签类型:dos磁盘标识符:0x000c60db 设备 Boot Start End Blocks Id System/dev/sda1 2048 6143 2048 83 Linux/dev/sda2 * 6144 415743 204800 83 Linux/dev/sda3 415744 1030143 307200 83 Linux/dev/sda4 1030144 104857599 51913728 5 Extended/dev/sda5 1032192 1048575 8192 82 Linux swap / Solaris/dev/sda6 1050624 104857599 51903488 83 Linux磁盘 /dev/sdb:107.4 GB, 107374182400 字节,209715200 个扇区Units = 扇区 of 1 * 512 = 512 bytes扇区大小(逻辑/物理):512 字节 / 512 字节I/O 大小(最小/最佳):512 字节 / 512 字节磁盘标签类型:dos磁盘标识符:0xea33e4e1 设备 Boot Start End Blocks Id System/dev/sdb1 2048 209715199 104856576 83 Linux
mkfs.xfs /dev/sdb1mkdir /datamount /dev/sdb1 /data blkid #获取UUID vim /etc/fstab # UUID=83b02679-f929-4905-be55-4bf5603fb98c /data xfs defaults 0 0