@huynh
2016-06-17T11:04:09.000000Z
字数 1398
阅读 5558
Linux
硬盘
分区
[root@slave2 /]# fdisk -l
WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.
Disk /dev/sdb: 26902.1 GB, 26902065053696 bytes
255 heads, 63 sectors/track, 3270656 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sdb1 1 267350 2147483647+ ee GPT
Partition 1 does not start on physical sector boundary.
Disk /dev/sda: 1099.5 GB, 1099511103488 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x0003ebef
Device Boot Start End Blocks Id System
/dev/sda1 * 1 64 512000 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 64 8223 65536000 82 Linux swap / Solaris
/dev/sda3 8223 133675 1007691776 83 Linux
可以看出目前系统只挂载了sda分区,而sdb分区并未使用
fdisk /dev/sdb
1、查看帮助。
输入:m
2、新建分区。
输入:n
3、创建逻辑分区
输入:p
4、输入分区号以及指定分区大小
依照提示,回车表示默认。
5、检查分区情况(此时还未执行分区操作)
Command(m for help):p
6、保存退出
Command(m for help):w
parted /dev/sdb (用part命令对3T硬盘进行分区处理)
mklabel gpt (用gpt格式可以将3TB弄在一个分区里)
unit TB (设置单位为TB)
mkpart primary 0 3 (设置为一个主分区,大小为3TB,开始是0,结束是3)
print (显示设置的分区大小)
quit (退出parted程序)
mkfs.ext4 /dev/sdb1
目录:mkdir /home/sdb1
挂载:mount /dev/sdb1 /home/sdb1
打开:vim /etc/fstab
添加:/dev/sdb1 /home/sdb1 ext4 defaults 1 1