fdisk /dev/sdb1 Command (m for help): n 创建新分区 Command action e extended p primary partition (1-4) p 创建主分区 Partition number (1-4): 1 新建的主分区序号 First cylinder (1-10402, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-10402, default 10402): +79G 创建主分区大小 Command (m for help): w 保存创建的主分区 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ fdisk /dev/sdb2 Command (m for help): n 创建新分区 Command action e extended p primary partition (1-4) p 创建主分区 Partition number (1-4): 1 新建的主分区序号 First cylinder (1-10402, default 1): Using default value 1 Last cylinder or +size or +sizeM or +sizeK (1-10402, default 10402): 创建主分区大小 Command (m for help): w 保存创建的主分区 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 快速格式化分区ext4 mkfs.ext4 -T largefile /dev/sdb1 mkfs.ext4 -T largefile /dev/sdb2 挂载目录 mount /dev/sdb1 /var/lib/mysql mount /dev/sdb2 /home/wq/ 查看挂载目录 df -TH /dev/sdb1 ext4 105G 197M 100G 1% /var/lib/mysql /dev/sdb2 ext4 107G 197M 102G 1% /home/wq 使新创建的分区在系统中立即生效 partprobe (或者partx) 开机自动挂载 查看硬盘号 blkid /dev/sdb1 /dev/sdb1: UUID="808192e2-1bcd-4eb2-94b5-aa88e1e3689a" TYPE="ext4" blkid /dev/sdb2 /dev/sdb2: UUID="9c061bf2-b79b-4c4c-a551-61f3851f891e" TYPE="ext4" vi /etc/fstab 添加开机挂载目录 UUID=808192e2-1bcd-4eb2-94b5-aa88e1e3689a /var/lib/mysql ext4 defaults 0 1 UUID=9c061bf2-b79b-4c4c-a551-61f3851f891e /home/wq/ ext4 defaults 0 0 重启服务器 reboot 查看挂载目录 df -TH |
|
来自: qweertt4747 > 《Linux》