centos7.6 新增磁盘,将/data目录挂载到新磁盘上

# 1 查看新增磁盘:为sdb
[root@localhost ~]# lsblk
NAME   MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda      8:0    0   40G  0 disk
├─sda1   8:1    0  300M  0 part /boot
├─sda2   8:2    0    2G  0 part [SWAP]
└─sda3   8:3    0 37.7G  0 part /
sdb      8:16   0   30G  0 disk
sr0     11:0    1 1024M  0 rom
[root@localhost ~]# fdisk -l

Disk /dev/sdb: 32.2 GB, 32212254720 bytes, 62914560 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 /dev/sda: 42.9 GB, 42949672960 bytes, 83886080 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: 0x000969b2

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      616447      307200   83  Linux
/dev/sda2          616448     4812799     2098176   82  Linux swap / Solaris
/dev/sda3         4812800    83886079    39536640   83  Linux

# 2 格式化磁盘

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

# 3 创建/data目录
[root@localhost ~]# mkdir /data

# 4 查看/dev/sdb新磁盘格式化后磁盘的UUID号
[root@localhost ~]# blkid
/dev/sdb: UUID="93ca19c7-2ff5-495e-96d1-124748dd04bd" TYPE="xfs"
/dev/sda1: UUID="27999350-1704-4f8b-9ed7-269f05b3a4de" TYPE="xfs"
/dev/sda2: UUID="51342670-5eb0-40da-b36d-daae9c3689e1" TYPE="swap"
/dev/sda3: UUID="6b58f95b-ff2b-4eb6-b831-9df2e2f2eccf" TYPE="xfs"

# 5 进入磁盘目录进行与/data目录进行绑定
[root@localhost ~]# vim /etc/fstab

#  6 执行挂载命令
[root@localhost ~]# mount -a

#  7 新增磁盘挂载完成。
[root@localhost ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        38G  7.8G   30G  21% /
devtmpfs        898M     0  898M   0% /dev
tmpfs           912M     0  912M   0% /dev/shm
tmpfs           912M  9.0M  903M   1% /run
tmpfs           912M     0  912M   0% /sys/fs/cgroup
/dev/sda1       297M  157M  141M  53% /boot
tmpfs           183M     0  183M   0% /run/user/0
/dev/sdb         30G   33M   30G   1% /data
[root@localhost ~]#

  • 6
    点赞
  • 11
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

DATA TOO

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值