美文网首页Linux学习|Gentoo/Arch/FreeBSDLinux我用 Linux
亚马逊Amazon Linux 2 AMI磁盘挂载实践

亚马逊Amazon Linux 2 AMI磁盘挂载实践

作者: 承诺一时的华丽 | 来源:发表于2019-10-28 10:56 被阅读0次

    1、查看已挂载好的磁盘,命令:df -h

    > df -h
    Filesystem      Size  Used Avail Use% Mounted on
    devtmpfs        7.9G     0  7.9G   0% /dev
    tmpfs           7.9G     0  7.9G   0% /dev/shm
    tmpfs           7.9G  416K  7.9G   1% /run
    tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
    /dev/xvda1       50G  1.6G   49G   4% /
    tmpfs           1.6G     0  1.6G   0% /run/user/1000
    

    2、列出可用磁盘,命令:lsblk -l

    > lsblk -l
    NAME  MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    xvda  202:0    0   50G  0 disk 
    xvda1 202:1    0   50G  0 part /
    xvdb  202:16   0  500G  0 disk 
    

    3、找到为挂载的磁盘xvdb并格式化磁盘,命令:sudo mkfs.xfs -f /dev/xvdb

    > sudo mkfs.xfs -f /dev/xvdb
    meta-data=/dev/xvdb              isize=512    agcount=4, agsize=32768000 blks
             =                       sectsz=512   attr=2, projid32bit=1
             =                       crc=1        finobt=1, sparse=0
    data     =                       bsize=4096   blocks=131072000, imaxpct=25
             =                       sunit=0      swidth=0 blks
    naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
    log      =internal log           bsize=4096   blocks=64000, version=2
             =                       sectsz=512   sunit=0 blks, lazy-count=1
    realtime =none                   extsz=4096   blocks=0, rtextents=0
    

    4、将磁盘挂载到指定目录位置,命令:sudo mount -t xfs /dev/xvdb /home/zxb

    > sudo mount -t xfs /dev/xvdb /home/zxb
    

    5、查看挂载是否成功,命令:df -h

    > df -h
    Filesystem      Size  Used Avail Use% Mounted on
    devtmpfs        7.9G     0  7.9G   0% /dev
    tmpfs           7.9G     0  7.9G   0% /dev/shm
    tmpfs           7.9G  416K  7.9G   1% /run
    tmpfs           7.9G     0  7.9G   0% /sys/fs/cgroup
    /dev/xvda1       50G  1.6G   49G   4% /
    tmpfs           1.6G     0  1.6G   0% /run/user/1000
    /dev/xvdb       500G  543M  500G   1% /home/zxb
    
    • 磁盘已挂载成功

    相关文章

      网友评论

        本文标题:亚马逊Amazon Linux 2 AMI磁盘挂载实践

        本文链接:https://www.haomeiwen.com/subject/dibvvctx.html