zoukankan      html  css  js  c++  java
  • Linux 挂载2T以上存储

    在生产环境中,我们会遇到分区大于2T的磁盘(比如:添加一个3TB的存储),由于MBR分区表只支持2T磁盘,所以大于2T的磁盘必须使用GPT分区表

    而fdisk是不支持GPT分区的,我们可以使用parted来对GPT磁盘操作。parted功能很强大,既可用命令行也可以用于交互式,在提示符下输入parted就会进入交互式模式,如果有多个磁盘的话,我们需要运行select sdX(X为磁盘)来进行磁盘的选择,也可直接用parted /dev/sdX指定相应的硬盘

    查看磁盘信息:
    [root@yoon ~]# fdisk -l


    Disk /dev/sdm: 299.4 GB, 299439751168 bytes
    255 heads, 63 sectors/track, 36404 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: 0x2ebc66f6


    Device Boot Start End Blocks Id System
    /dev/sdm1 1 2089 16777216 82 Linux swap / Solaris
    /dev/sdm2 * 2089 36405 275643392 83 Linux


    Disk /dev/sdn: 3200.0 GB, 3199999672320 bytes
    255 heads, 63 sectors/track, 389044 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: 0x00000000


    [root@yoon ~]# parted
    GNU Parted 2.1
    浣跨敤 /dev/sda
    Welcome to GNU Parted! Type 'help' to view a list of commands.
    (parted)

    (parted) select /dev/sdn //选择磁盘sdn
    浣跨敤 /dev/sdn


    (parted) mklabel gpt //将MBR磁盘格式化为GPT

    (parted) mkpart primary 0 -1 //将整块磁盘分成一个分区

    (parted) quit //退出


    [root@yoon ~]# mkfs.ext4 /dev/sdn1 //格式化
    mke2fs 1.41.12 (17-May-2010)
    Discarding device blocks: 20447232/454545159

    [root@yoon ~]# mkdir /io

    [root@yoon ~]# mount /dev/sdn1 /io //挂载

    [root@yoon ~]# blkid /dev/sdn1
    /dev/sdn1: UUID="5abd6300-8375-4310-b1b5-5daf8576d6ff" TYPE="ext4"

    [root@yoon ~]# vi /etc/fstab

    UUID=5abd6300-8375-4310-b1b5-5daf8576d6ff /io ext4 defaults 1 2

    [root@yoon ~]# df -h
    /dev/sdn1 2.9T 200M 2.8T 1% /io

  • 相关阅读:
    python入门(变量命名规则)
    基础数据类型(不可变数据类型)
    记录Linux下安装elasticSearch时遇到的一些错误
    利用谷歌 kaptcha 进行验证码生成
    分布式拒绝服务攻击
    python3.5文档
    python反射机制
    tornado 使用tornado让你的请求异步非阻塞
    tornado的入门教程
    spark 环境变量系列配置
  • 原文地址:https://www.cnblogs.com/hankyoon/p/5169490.html
Copyright © 2011-2022 走看看