linux挂载大磁盘

如果挂载大于2T的磁盘如要使用parted

[root@RHEL7 ~]# parted /dev/sda
GNU Parted 3.1
使用 /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: Lenovo 720ix (scsi)
Disk /dev/sda: 22.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                  标志
 1      1049kB  538MB   537MB   fat16           EFI System Partition  启动
 2      538MB   1075MB  537MB   xfs
 3      1075MB  19.9GB  18.9GB  xfs
 4      19.9GB  20.5GB  537MB   linux-swap(v1)

(parted) mklabel gpt                    #第一次需要格式化分区,如果是在之前基础上添加分区则不需要                                  
警告: 正在使用 /dev/sda 上的分区。
忽略/Ignore/放弃/Cancel? ^C                                               
(parted) mkpart p5                                                # 创建一个分区        
文件系统类型?  [ext2]? xfs                                               # 起始结束点
起始点? 20.5G
结束点? 500G                                                             
(parted) print                                                            
Model: Lenovo 720ix (scsi)
Disk /dev/sda: 22.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                  标志
 1      1049kB  538MB   537MB   fat16           EFI System Partition  启动
 2      538MB   1075MB  537MB   xfs
 3      1075MB  19.9GB  18.9GB  xfs
 4      19.9GB  20.5GB  537MB   linux-swap(v1)
 5      20.5GB  500GB   480GB                   p5

[root@RHEL7 ~]# parted -s /dev/sda print #打印分区
Model: Lenovo 720ix (scsi)
Disk /dev/sda: 22.0TB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system     Name                  标志
 5      20.5GB  500GB   480GB                   p5

[root@RLEL7 ~]# mkfs  -t xfs /dev/sda5  # 格式化分区
meta-data=/dev/sda5              isize=256    agcount=4, agsize=29267200 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0        finobt=0
data     =                       bsize=4096   blocks=117068800, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal log           bsize=4096   blocks=57162, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
[root@RHEL7 ~]# 
[root@RHEL ~]# mkdir /u01
[root@RHEL7 ~]# vim /etc/fstab 
/dev/sda5       /u01    xfs     defaults        0 0
~
"/etc/fstab" 13L, 641C 已写入                                                                                 
[root@RHEL7 ~]# mount -a #挂载分区




你可能感兴趣的:(OS)