• 超过2T,磁盘分区


    MBR:MBR分区表(即主引导记录)大家都很熟悉。所支持的最大卷:2T,而且对分区有限制:最多4个主分区或3个主分区加一个扩展分区

    GPT: GPT(即GUID分区表)。是源自EFI标准的一种较新的磁盘分区表结构的标准,是未来磁盘分区的主要形式。与MBR分区方式相比,具有如下优点。突破MBR 4个主分区限制,每个磁盘最多支持128个分区。支持大于2T的分区,最大卷可达18EB。

    -.使用parted

    没有parted命令

    #yum -y install parted

    1、将、dev/sdb 分区

    parted /dev/sdb

    2、设置分区的类型

    (parted) mklabel gpt

    3、打印分区信息

    (parted) p

    4、分区

    mkpart primary 0KB 40.0TB
    输出:
    rning: You requested a partition from 0.00B to 40.0TB.                  
    The closest location we can manage is 17.4kB to 40.0TB.
    Is this still acceptable to you?
    Yes/No? yes (输入yes)                                                           
    Warning: The resulting partition is not properly aligned for best performance.
    Ignore/Cancel? i (输入i)

    5、查看分区分区信息和退出

    (parted) p
     Model: HP LOGICAL VOLUME (scsi)
     Disk /dev/sdb: 40.0TB
     Sector size (logical/physical): 512B/4096B
     Partition Table: gpt
     Number  Start   End     Size    File system  Name     Flags
       1      17.4kB  40.0TB  40.0TB               primary
    (parted) quit

    二、xfs格式化大分区
     

     #yum install kmod-xfs xfsprogs
     #modprobe xfs       //载入xfs文件系统模块
     #lsmod |grep xfs    //查看是否载入了xfs模块

    用xfs格式化并挂载

     #mkfs.xfs -f /dev/sdb1
     #mount /dev/sdb1 /data

    设置系统启动自动挂载分区

    #cat  /etc/fstab
         /dev/sdb1  /data xfs  defaults  0  0

    查看所有磁盘的状态

    # parted -l

    删除分区

    (parted) p                                                                
    Model: VMware, VMware Virtual S (scsi)
    Disk /dev/sdb: 21.5GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End     Size    File system  Name  Flags
     1      17.4kB  21.5GB  21.5GB               gzh
    
    
    
    
    
    (parted)  rm 1

    把分区误删除了恢复

    (parted) p                                                                
    Model: VMware, VMware Virtual S (scsi)
    Disk /dev/sdb: 21.5GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End     Size    File system  Name  Flags
     2      17.4kB  3000MB  3000MB  xfs          gzh
     1      10.0GB  21.5GB  11.5GB  xfs          gg
    
    (parted) rm 2                                                             
    (parted) p                                                                
    Model: VMware, VMware Virtual S (scsi)
    Disk /dev/sdb: 21.5GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End     Size    File system  Name  Flags
     1      10.0GB  21.5GB  11.5GB  xfs          gg
    
    (parted) rescue 
    Start? 0KB 
    End? 3GB                                                                  
    Information: A xfs primary partition was found at 17.4kB -> 3000MB.  Do you want to add it to the partition table?
    Yes/No/Cancel? yes                                                        
    
    (parted) p                                                                
    Model: VMware, VMware Virtual S (scsi)
    Disk /dev/sdb: 21.5GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End     Size    File system  Name  Flags
     2      17.4kB  3000MB  3000MB  xfs
     1      10.0GB  21.5GB  11.5GB  xfs          gg
    rm
  • 相关阅读:
    第三百三十二节,web爬虫讲解2—Scrapy框架爬虫—Scrapy使用
    trim思考
    国王验毒酒问题
    有人在群里问mysql如何选择性更新部分条件的问题
    有人在群里问 20180222055怎么转20180222-055 这样的问题
    如何下载腾讯视频的视频转为MP4常用格式视频
    天气预报的大雪真的下了
    群友面试的问题 我搞笑的帮忙回答一下
    电台大神打油诗
    ajax简单手写了一个猜拳游戏
  • 原文地址:https://www.cnblogs.com/zhenhui/p/5775936.html
Copyright © 2020-2023  润新知