==正常情况下 fdisk 划分分区 需要重新启动系统,通过partprobe 命令 就不需要重新启动==

mount     挂载命令   


    选项: 

        -a    重新加载/etc/fstab这个文件 

        -t      指定挂载的文件系统

              [root@qls ~]# mount -t  xfs  /dev/sdb1  test_mbr/

        -o    指定挂载的参数
使用UUID的信息挂载
[root@qls ~]# blkid
第一列:挂载的设备名称,UUID信息,网络地址 

第二列:挂载点,挂载的目录

第三列:文件系统的类型   xfs   ext4  ext3  nfs  gfs  

第四列:挂载的参数,defaults    默认挂载的参数 


    async/sync      是否同步还是异步   async  

    user/nouser        普通用户是否可以执行mount命令

    exec/noexec        文件是否可以执行 exec 

    auto/noauto        在执行mount -a  是否重新加载/etc/fstab  auto 

    suid/nosuid        是否存在uid属性信息  suid  

    ro/rw            可读,读写   rw  

    defaults        async  nouser exec auto suid  rw


第五列:dump 备份 是否使用dump命令进行备份

    0         表示不备份 
    1        表示每天备份
    2        表示不定期的备份

第六列:fsck  检查磁盘   是否检查磁盘 

    0       表示不检查  
    1        检查,按照数字顺序进行检查,根分区
    2        按照顺序检查


卸载  

umount            卸载的命令  

    -l          强制卸载
wap    虚拟内存  


OOM   out  of  memory      内存溢出

Out of memory: Kill process 1365 (dd) score 774 or sacrifice child


添加虚拟内存空间 


第一步

#生成一个1G磁盘分区
[root@qls ~]# fdisk   /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.


Command (m for help): p

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa0aa57fb

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   83  Linux
/dev/sdb4        10487808    31459327    10485760    5  Extended
/dev/sdb5        10489856    20975615     5242880   83  Linux
/dev/sdb6        20977664    31459327     5240832   83  Linux

Command (m for help): n
Partition type:
   p   primary (1 primary, 1 extended, 2 free)
   l   logical (numbered from 5)
Select (default p): p
Partition number (2,3, default 2): 
First sector (31459328-41943039, default 31459328): 
Using default value 31459328
Last sector, +sectors or +size{K,M,G} (31459328-41943039, default 41943039): +1G
Partition 2 of type Linux and of size 1 GiB is set

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@qls ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   50G  0 disk 
├─sda1   8:1    0  500M  0 part /boot
├─sda2   8:2    0    2G  0 part 
└─sda3   8:3    0 47.5G  0 part /
sdb      8:16   0   20G  0 disk 
├─sdb1   8:17   0    5G  0 part /root/test_mbr
├─sdb2   8:18   0    1G  0 part 
├─sdb4   8:20   0    1K  0 part 
├─sdb5   8:21   0    5G  0 part 
└─sdb6   8:22   0    5G  0 part 
sdc      8:32   0    3T  0 disk 
└─sdc1   8:33   0    3T  0 part /root/test_gpt
sr0     11:0    1  4.3G  0 rom 



第二步
让这个磁盘分区成为swap

[root@qls ~]# mkswap   /dev/sdb2
Setting up swapspace version 1, size = 1048572 KiB
no label, UUID=eefd542c-3986-46ea-a7a4-43af2775a6e9


第三步 

添加swap空间  



[root@qls ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            972         115         798           7          58         754
Swap:          2047           0        2047

[root@qls ~]# swapon   /dev/sdb2
[root@qls ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            972         116         797           7          58         753
Swap:          3071           0        3071



#检查磁盘分区是否为swap
[root@qls ~]# swapon -s
Filename                Type        Size    Used    Priority
/dev/sda2                                  partition    2097148    0    -2
/dev/sdb2                                  partition    1048572    0    -3
[root@qls ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   50G  0 disk 
├─sda1   8:1    0  500M  0 part /boot
├─sda2   8:2    0    2G  0 part [SWAP]
└─sda3   8:3    0 47.5G  0 part /
sdb      8:16   0   20G  0 disk 
├─sdb1   8:17   0    5G  0 part /root/test_mbr
├─sdb2   8:18   0    1G  0 part [SWAP]
├─sdb4   8:20   0    1K  0 part 
├─sdb5   8:21   0    5G  0 part 
└─sdb6   8:22   0    5G  0 part 
sdc      8:32   0    3T  0 disk 
└─sdc1   8:33   0    3T  0 part /root/test_gpt
sr0     11:0    1  4.3G  0 rom  

#去除添加swap空间
[root@qls ~]# swapoff  /dev/sdb2
[root@qls ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            972         115         798           7          58         754
Swap:          2047           0        2047



#禁用swap
[root@qls ~]# swapoff  -a
[root@qls ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            972         115         798           7          58         754
Swap:             0           0           0


#启用swap 

[root@qls ~]# swapon -a
[root@qls ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            972         115         798           7          58         754
Swap:          2047           0        2047



#生成一个大文件,让这个文件成为swap

[root@qls ~]# dd  if=/dev/zero  of=/root/swap.log  bs=100M  count=10
10+0 records in
10+0 records out
1048576000 bytes (1.0 GB) copied, 8.5368 s, 123 MB/s



#让这个文件成为swap  


[root@qls ~]# mkswap  -f  /root/swap.log
Setting up swapspace version 1, size = 1023996 KiB
no label, UUID=55f73ed6-caae-4acb-9497-fce6b76e2126
[root@qls ~]# file /root/swap.log
/root/swap.log: Linux/i386 swap file (new style), version 1 (4K pages), size 255999 pages, no label, UUID=55f73ed6-caae-4acb-9497-fce6b76e2126


#设置权限为600  
[root@qls ~]# chmod 600  /root/swap.log


#启用这个文件为swap空间
[root@qls ~]# swapon  /root/swap.log
[root@qls ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:            972         116         168           7         687         706
Swap:          3047           0        3047

分区工具         fdisk  
第一步        
1. 添加硬盘    20G   
重启服务器    reboot
检查结果
[root@qls ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   50G  0 disk 
├─sda1   8:1    0  500M  0 part /boot
├─sda2   8:2    0    2G  0 part [SWAP]
└─sda3   8:3    0 47.5G  0 part /
sdb      8:16   0   20G  0 disk 
sdc      8:32   0    3T  0 disk 
sr0     11:0    1  4.3G  0 rom 

第二步        
2.进行分区   fdisk         
#执行分区命令          
[root@qls ~]# fdisk   /dev/sdb        
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                            #删除分区
   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)
Command (m for help): n              #创建新的分区   
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p):      回车            #选择主分区或者扩展分区,默认是主分区
Using default response p
Partition number (1-4, default 1):    回车    #选择分区的id ,默认从1开始
First sector (2048-41943039, default 2048):      #选择扇区的开始位置  
Using default value 2048
                                                #选择扇区的结束位置
Last sector, +sectors or +size{K,M,G} (2048-41943039, default 41943039): +5G    #5G大小
Partition 1 of type Linux and of size 5 GiB is set         

Command (m for help): p            #检查分区表信息

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa0aa57fb

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   83  Linux

#添加一个扩展分区
Command (m for help): n
Partition type:
   p   primary (1 primary, 0 extended, 3 free)
   e   extended
Select (default p): e
Partition number (2-4, default 2): 4
First sector (10487808-41943039, default 10487808): 
Using default value 10487808
Last sector, +sectors or +size{K,M,G} (10487808-41943039, default 41943039): +10G
Partition 4 of type Extended and of size 10 GiB is set

Command (m for help): p

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa0aa57fb

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   83  Linux
/dev/sdb4        10487808    31459327    10485760    5  Extended

#创建逻辑分区
Command (m for help): n
Partition type:
   p   primary (1 primary, 1 extended, 2 free)
   l   logical (numbered from 5)
Select (default p): l
Adding logical partition 5
First sector (10489856-31459327, default 10489856): 
Using default value 10489856
Last sector, +sectors or +size{K,M,G} (10489856-31459327, default 31459327): +5G
Partition 5 of type Linux and of size 5 GiB is set

Command (m for help): p

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa0aa57fb

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   83  Linux
/dev/sdb4        10487808    31459327    10485760    5  Extended
/dev/sdb5        10489856    20975615     5242880   83  Linux

Command (m for help): n
Partition type:
   p   primary (1 primary, 1 extended, 2 free)
   l   logical (numbered from 5)
Select (default p): l
Adding logical partition 6
First sector (20977664-31459327, default 20977664): 
Using default value 20977664
Last sector, +sectors or +size{K,M,G} (20977664-31459327, default 31459327): 
Using default value 31459327
Partition 6 of type Linux and of size 5 GiB is set

Command (m for help): p

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa0aa57fb

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   83  Linux
/dev/sdb4        10487808    31459327    10485760    5  Extended
/dev/sdb5        10489856    20975615     5242880   83  Linux
/dev/sdb6        20977664    31459327     5240832   83  Linux

#删除一个分区
Command (m for help): d
Partition number (1,4-6, default 6): 6
Partition 6 is deleted

Command (m for help): p

Disk /dev/sdb: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0xa0aa57fb

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    10487807     5242880   83  Linux
/dev/sdb4        10487808    31459327    10485760    5  Extended
/dev/sdb5        10489856    20975615     5242880   83  Linux
#保存退出
Command (m for help): w            
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
#最后的检查结果    一个主分区   一个扩展分区   两个逻辑分区
[root@qls ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   50G  0 disk 
├─sda1   8:1    0  500M  0 part /boot
├─sda2   8:2    0    2G  0 part [SWAP]
└─sda3   8:3    0 47.5G  0 part /
sdb      8:16   0   20G  0 disk 
├─sdb1   8:17   0    5G  0 part 
├─sdb4   8:20   0    1K  0 part 
├─sdb5   8:21   0    5G  0 part 
└─sdb6   8:22   0    5G  0 part 
sdc      8:32   0    3T  0 disk 
sr0     11:0    1  4.3G  0 rom  

4个主分区   
3个主分区+1个扩展分区
第三步

#3.格式化及创建文件系统

centos-7    默认的文件系统   xfs  
centos-6    默认是ext4
[root@qls ~]# mkfs.xfs    /dev/sdb1
meta-data=/dev/sdb1              isize=512    agcount=4, agsize=327680 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=1310720, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
第四步
临时挂载 
4.建立挂载点,进行挂载使用
[root@qls ~]# mkdir   test_mbr  
#进行挂载  
[root@qls ~]# mount  /dev/sdb1  test_mbr
#检查  
[root@qls ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        476M     0  476M   0% /dev
tmpfs           487M     0  487M   0% /dev/shm
tmpfs           487M  7.6M  479M   2% /run
tmpfs           487M     0  487M   0% /sys/fs/cgroup
/dev/sda3        48G  5.7G   42G  12% /
/dev/sda1       497M  148M  350M  30% /boot
tmpfs            98M     0   98M   0% /run/user/0
/dev/sdb1       5.0G   33M  5.0G   1% /root/test_mbr
#测试写入数据  
[root@qls ~]# cp  /etc/services   test_mbr/
[root@qls ~]# ll test_mbr/
total 656
-rw-r--r--. 1 root root 670293 Nov 20 10:17 services

第五步  
永久挂载  
/etc/fstab   
#将挂载信息写入到配置文件中
[root@qls ~]# tail  -1  /etc/fstab
/dev/sdb1                  /root/test_mbr          xfs     defaults        0 0
#将/etc/fstab文件中的挂载列表进行重新加载
[root@qls ~]# mount  -a
[root@qls ~]# df  -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        476M     0  476M   0% /dev
tmpfs           487M     0  487M   0% /dev/shm
tmpfs           487M  7.6M  479M   2% /run
tmpfs           487M     0  487M   0% /sys/fs/cgroup
/dev/sda3        48G  5.7G   42G  12% /
/dev/sda1       497M  148M  350M  30% /boot
tmpfs            98M     0   98M   0% /run/user/0
/dev/sdb1       5.0G   33M  5.0G   1% /root/test_mbr
#最后进行reboot重启测试 
[root@qls ~]# df  -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        476M     0  476M   0% /dev
tmpfs           487M     0  487M   0% /dev/shm
tmpfs           487M  7.6M  479M   2% /run
tmpfs           487M     0  487M   0% /sys/fs/cgroup
/dev/sda3        48G  5.7G   42G  12% /
/dev/sdb1       5.0G   33M  5.0G   1% /root/test_mbr
/dev/sda1       497M  148M  350M  30% /boot
tmpfs            98M     0   98M   0% /run/user/0
gdisk         适用于各种大小    128个主分区  

            GPT

[root@qls ~]# yum install   -y gdisk



第一步  

#1. 添加磁盘   3T  

[root@qls ~]# lsblk 
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   50G  0 disk 
├─sda1   8:1    0  500M  0 part /boot
├─sda2   8:2    0    2G  0 part [SWAP]
└─sda3   8:3    0 47.5G  0 part /
sdb      8:16   0   20G  0 disk 
├─sdb1   8:17   0    5G  0 part /root/test_mbr
├─sdb4   8:20   0    1K  0 part 
├─sdb5   8:21   0    5G  0 part 
└─sdb6   8:22   0    5G  0 part 
sdc      8:32   0    3T  0 disk 
sr0     11:0    1  4.3G  0 rom  



第二步

#2.使用gdisk命令进行分区  

#查看硬盘信息  
[root@qls ~]# gdisk  -l  /dev/sdc
GPT fdisk (gdisk) version 0.8.10

Partition table scan:
  MBR: not present
  BSD: not present
  APM: not present
  GPT: not present

Creating new GPT entries.
Disk /dev/sdc: 6442450944 sectors, 3.0 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): EB28ED9F-957B-4397-9B92-654D0EBEA503
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 6442450910
Partitions will be aligned on 2048-sector boundaries
Total free space is 6442450877 sectors (3.0 TiB)

Number  Start (sector)    End (sector)  Size       Code  Name


#开始分区  

Command (? for help): ?
b    back up GPT data to a file
c    change a partition's name
d    delete a partition                                        #删除分区  
i    show detailed information on a partition
l    list known partition types                                #显示已知分区类型
n    add a new partition                                        #创建分区
o    create a new empty GUID partition table (GPT)
p    print the partition table                                #打印分区表  
q    quit without saving changes                                #退出不保存  
r    recovery and transformation options (experts only)        
s    sort partitions
t    change a partition's type code
v    verify disk
w    write table to disk and exit                            #保存退出  
x    extra functionality (experts only)
?    print this menu                                            #菜单




Command (? for help): n           #创建分区  
Partition number (1-128, default 1):         #选择分区编号  
First sector (34-6442450910, default = 2048) or {+-}size{KMGTP}:         #扇区的起始位置
Last sector (2048-6442450910, default = 6442450910) or {+-}size{KMGTP}:     #结束位置
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): L                #显示所有分区类型
0700 Microsoft basic data  0c01 Microsoft reserved    2700 Windows RE          
3000 ONIE boot             3001 ONIE config           4100 PowerPC PReP boot   
4200 Windows LDM data      4201 Windows LDM metadata  7501 IBM GPFS            
7f00 ChromeOS kernel       7f01 ChromeOS root         7f02 ChromeOS reserved   
8200 Linux swap            8300 Linux filesystem      8301 Linux reserved      
8302 Linux /home           8400 Intel Rapid Start     8e00 Linux LVM           
a500 FreeBSD disklabel     a501 FreeBSD boot          a502 FreeBSD swap        
a503 FreeBSD UFS           a504 FreeBSD ZFS           a505 FreeBSD Vinum/RAID  
a580 Midnight BSD data     a581 Midnight BSD boot     a582 Midnight BSD swap   
a583 Midnight BSD UFS      a584 Midnight BSD ZFS      a585 Midnight BSD Vinum  
a800 Apple UFS             a901 NetBSD swap           a902 NetBSD FFS          
a903 NetBSD LFS            a904 NetBSD concatenated   a905 NetBSD encrypted    
a906 NetBSD RAID           ab00 Apple boot            af00 Apple HFS/HFS+      
af01 Apple RAID            af02 Apple RAID offline    af03 Apple label         
af04 AppleTV recovery      af05 Apple Core Storage    be00 Solaris boot        
bf00 Solaris root          bf01 Solaris /usr & Mac Z  bf02 Solaris swap        
bf03 Solaris backup        bf04 Solaris /var          bf05 Solaris /home       
bf06 Solaris alternate se  bf07 Solaris Reserved 1    bf08 Solaris Reserved 2  
bf09 Solaris Reserved 3    bf0a Solaris Reserved 4    bf0b Solaris Reserved 5  
c001 HP-UX data            c002 HP-UX service         ea00 Freedesktop $BOOT   
eb00 Haiku BFS             ed00 Sony system partitio  ed01 Lenovo system partit
Press the <Enter> key to see more codes:             #回车翻页
ef00 EFI System            ef01 MBR partition scheme  ef02 BIOS boot partition 
fb00 VMWare VMFS           fb01 VMWare reserved       fc00 VMWare kcore crash p
fd00 Linux RAID            
Hex code or GUID (L to show codes, Enter = 8300):         #回车,选择默认分区类型 
Changed type of partition to 'Linux filesystem'

Command (? for help): p                #打印分区表  
Disk /dev/sdc: 6442450944 sectors, 3.0 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 913A15CF-7D05-4FCF-814B-89757D9FD935
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 6442450910
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048      6442450910   3.0 TiB     8300  Linux filesystem


Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y            #是否继续向下执行
OK; writing new GUID partition table (GPT) to /dev/sdc.
The operation has completed successfully.


第三步 

#3. 格式化及创建文件系统


[root@qls ~]# mkfs.xfs   /dev/sdc1  
meta-data=/dev/sdc1              isize=512    agcount=4, agsize=201326527 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0, sparse=0
data     =                       bsize=4096   blocks=805306107, imaxpct=5
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal log           bsize=4096   blocks=393215, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0



第四步

#4. 建立挂载点,进行挂载使用

临时挂载 
[root@qls ~]# mkdir  test_gpt
[root@qls ~]# mount  /dev/sdc1  test_gpt

[root@qls ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   50G  0 disk 
├─sda1   8:1    0  500M  0 part /boot
├─sda2   8:2    0    2G  0 part [SWAP]
└─sda3   8:3    0 47.5G  0 part /
sdb      8:16   0   20G  0 disk 
├─sdb1   8:17   0    5G  0 part /root/test_mbr
├─sdb4   8:20   0  512B  0 part 
├─sdb5   8:21   0    5G  0 part 
└─sdb6   8:22   0    5G  0 part 
sdc      8:32   0    3T  0 disk 
└─sdc1   8:33   0    3T  0 part /root/test_gpt
sr0     11:0    1  4.3G  0 rom  
[root@qls ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
devtmpfs        476M     0  476M   0% /dev
tmpfs           487M     0  487M   0% /dev/shm
tmpfs           487M  7.6M  479M   2% /run
tmpfs           487M     0  487M   0% /sys/fs/cgroup
/dev/sda3        48G  5.7G   42G  12% /
/dev/sdb1       5.0G   33M  5.0G   1% /root/test_mbr
/dev/sda1       497M  148M  350M  30% /boot
tmpfs            98M     0   98M   0% /run/user/0
/dev/sdc1       3.0T   33M  3.0T   1% /root/test_gpt

#测试存放数据
[root@qls ~]# dd  if=/dev/zero  of=/root/test_gpt/test.log  bs=100M  count=100
100+0 records in
100+0 records out
10485760000 bytes (10 GB) copied, 9.09239 s, 1.2 GB/s
[root@qls ~]# ll  test_gpt/
total 10240000
-rw-r--r--. 1 root root 10485760000 Nov 20 11:04 test.log



第五步  

永久挂载  

[root@qls ~]# tail  -1  /etc/fstab 
/dev/sdc1                                /root/test_gpt           xfs     defaults        0 0

#检查  
[root@qls ~]# mount  -a



parted    高级分区工具
Copyright © 高程程 all right reserved,powered by Gitbook修订于: 2021-05-18 21:14:13

results matching ""

    No results matching ""