author: headsen chen
date: 2018-09-12 11:52:02
[root@sz02 ~]# umount /var/lib/docker
[root@sz02 ~]# df -h
Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_sys-lv_root 226G 2.0G 224G 1% / devtmpfs 189G 0 189G 0% /dev tmpfs 189G 0 189G 0% /dev/shm tmpfs 189G 9.2M 189G 1% /run tmpfs 189G 0 189G 0% /sys/fs/cgroup /dev/sda1 1016M 141M 875M 14% /boot /dev/mapper/vg_sys-lv_log 20G 99M 20G 1% /var/log /dev/mapper/vg_sys-lv_tmp 1016M 33M 983M 4% /tmp tmpfs 38G 0 38G 0% /run/user/0
[root@sz02 ~]# lvs
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert lv_docker vg_dat -wi-a----- 894.19g lv_log vg_sys -wi-ao---- 20.00g lv_root vg_sys -wi-ao---- 225.34g lv_swap vg_sys -wi-ao---- 32.00g lv_tmp vg_sys -wi-ao---- 1.00g
[root@sz02 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 279.4G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 278.4G 0 part ├─vg_sys-lv_root 253:0 0 225.4G 0 lvm / ├─vg_sys-lv_swap 253:1 0 32G 0 lvm [SWAP] ├─vg_sys-lv_log 253:2 0 20G 0 lvm /var/log └─vg_sys-lv_tmp 253:3 0 1G 0 lvm /tmp sdb 8:16 0 894.2G 0 disk sdb1 8:17 0 894.2G 0 part ▽ └─vg_dat-lv_docker 253:4 0 894.2G 0 lvm
[root@sz02 ~]# lvremove /dev/vg_dat/lv_docker
Do you really want to remove active logical volume vg_dat/lv_docker? [y/n]: y # 手动输入y Logical volume "lv_docker" successfully removed
[root@sz02 ~]# vgremove /dev/vg_dat
Volume group "vg_dat" successfully removed
[root@sz02 ~]# pvremove /dev/sdb1
Labels on physical volume "/dev/sdb1" successfully wiped.
[root@sz02 ~]# lsblk /dev/sdb
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sdb 8:16 0 894.2G 0 disk └─sdb1 8:17 0 894.2G 0 part
[root@sz02 ~]# mkfs -t xfs /dev/sdb1
meta-data=/dev/sdb1 isize=512 agcount=32, agsize=7325248 blks = sectsz=4096 attr=2, projid32bit=1 = crc=1 finobt=0, sparse=0 data = bsize=4096 blocks=234407936, imaxpct=25 = sunit=64 swidth=128 blks naming =version 2 bsize=4096 ascii-ci=0 ftype=1 log =internal log bsize=4096 blocks=114457, version=2 = sectsz=4096 sunit=1 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0
[root@sz02 ~]# mount /dev/sdb1 /data
[root@sz02 ~]# df -h
Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_sys-lv_root 226G 2.0G 224G 1% / devtmpfs 189G 0 189G 0% /dev tmpfs 189G 0 189G 0% /dev/shm tmpfs 189G 9.2M 189G 1% /run tmpfs 189G 0 189G 0% /sys/fs/cgroup /dev/sda1 1016M 141M 875M 14% /boot /dev/mapper/vg_sys-lv_log 20G 99M 20G 1% /var/log /dev/mapper/vg_sys-lv_tmp 1016M 33M 983M 4% /tmp tmpfs 38G 0 38G 0% /run/user/0 /dev/sdb1 894G 34M 894G 1% /data
[root@sz02 ~]# touch /data/aa
[root@sz02 ~]# ls /data/aa
/data/aa
[root@sz02 ~]# vim /etc/fstab
# # /etc/fstab # Created by anaconda on Fri Jul 13 17:35:43 2018 # # Accessible filesystems, by reference, are maintained under '/dev/disk' # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info # /dev/mapper/vg_sys-lv_root / xfs defaults 0 0 UUID=d0864981-7355-47e0-ab1b-6ddbc5f4d1dc /boot xfs defaults 0 0 /dev/mapper/vg_sys-lv_tmp /tmp xfs nodev,nosuid,noexec 0 0 #/dev/mapper/vg_dat-lv_docker /var/lib/docker xfs defaults 0 0 /dev/sdb1 /data xfs defaults 0 0 /dev/mapper/vg_sys-lv_log /var/log xfs defaults 0 0 /dev/mapper/vg_sys-lv_swap swap swap defaults 0 0
~
~
~