思路:
1.图形界面添加存储,特性选择。
2.Linux划分存储。
1)使用parted分区工具划分硬盘分区
[root@arpdb-1310 ~]# parted /dev/sdb
(parted) mklabel gpt
# 将MBR磁盘格式化为GPT
(parted) print
#打印当前分区
(parted) mkpart primary 0 100%
# 分所有分区
[
(parted) mkpart primary
0 4.5TB
#
分一个4.5T的主分区
]
[
(parted) mkpart primary
4.5TB 12TB
# 分一个7.5T的主分区
]
2)格式化成ext4文件格式
[root@arpdb-1310 ~]# mkfs.ext4 /dev/sdb1
3)用mount挂载分区
mkdir /backup
mount -t ext4 /dev/sdb1 /backu
p
4)修改/etc/fstab,开机自动挂载
vim /etc/fstab
/dev/sdb1
/backu
p
ext4 defaults,noatime 1 2
####################################fdisk#########################################
####################################fdisk#########################################
思路:
1.图形界面添加存储,特性选择。
2.
Linux划分存储。
Command (m for help): m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
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)
Command (m for help): n
Command action
e extended
p primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-133674, default 1):
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-133674, default 133674):
Using default value 133674
Command (m for help): p
Disk /dev/sdb: 1099.5 GB, 1099511627776 bytes
255 heads, 63 sectors/track, 133674 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x3dc5f5a0
Device Boot Start End Blocks Id System
/dev/sdb1 1 133674 1073736373+ 83 Linux
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
2)格式化成ext4文件格式
[root@arpdb-1310 ~]# mkfs.ext4 /dev/sdb1
3)用mount挂载分区
mkdir /backup
mount -t ext4 /dev/sdb1 /backu
p
4)修改/etc/fstab,开机自动挂载
vim /etc/fstab
/dev/sdb1
/backu
p
ext4 defaults,noatime 1 2
****UUID的方式
[
root@arpdb-1320 ~]# ls -l /dev/disk/by-uuid/
total 0
lrwxrwxrwx. 1 root root 10 Jun 1 09:15 05c584ad-42f3-4b07-9730-93c687e7d0af -> ../../sda1
lrwxrwxrwx. 1 root root 10 Jun 1 09:15 261e6ee0-0727-4e1f-8a9c-abd4c86a67a0 -> ../../sda3
lrwxrwxrwx. 1 root root 10 Jun 15 14:43 b4ffc5a6-0ea8-41af-b52b-efe8dc50fd59 -> ../../sdb1
lrwxrwxrwx. 1 root root 10 Jun 1 09:15 bd0a09be-8b6c-42c3-b9a9-b709bf35d2a1 -> ../../sda2
total 0
lrwxrwxrwx. 1 root root 10 Jun 1 09:15 05c584ad-42f3-4b07-9730-93c687e7d0af -> ../../sda1
lrwxrwxrwx. 1 root root 10 Jun 1 09:15 261e6ee0-0727-4e1f-8a9c-abd4c86a67a0 -> ../../sda3
lrwxrwxrwx. 1 root root 10 Jun 15 14:43 b4ffc5a6-0ea8-41af-b52b-efe8dc50fd59 -> ../../sdb1
lrwxrwxrwx. 1 root root 10 Jun 1 09:15 bd0a09be-8b6c-42c3-b9a9-b709bf35d2a1 -> ../../sda2