Bo's Oracle Station

查看: 2359|回复: 0

课程第6次

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2019-4-16 20:23:54 | 显示全部楼层 |阅读模式
rescue:
  能够continue :  文件系统本身没有问题+原/etc/fstab内容正确。

  能够chroot: 在continue之后, 原/bin/bash和原/bin/mount没有丢失。


PV/VG/LV的小实验:
  1. [root@station60 ~]# fdisk -l

  2. Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
  3. Units = sectors of 1 * 512 = 512 bytes
  4. Sector size (logical/physical): 512 bytes / 512 bytes
  5. I/O size (minimum/optimal): 512 bytes / 512 bytes
  6. Disk label type: dos
  7. Disk identifier: 0x000db1f1

  8.    Device Boot      Start         End      Blocks   Id  System
  9. /dev/sda1   *        2048     2099199     1048576   83  Linux
  10. /dev/sda2         2099200    41943039    19921920   8e  Linux LVM

  11. Disk /dev/sdb: 1073 MB, 1073741824 bytes, 2097152 sectors
  12. Units = sectors of 1 * 512 = 512 bytes
  13. Sector size (logical/physical): 512 bytes / 512 bytes
  14. I/O size (minimum/optimal): 512 bytes / 512 bytes
  15. Disk label type: dos
  16. Disk identifier: 0x7380aaa7

  17.    Device Boot      Start         End      Blocks   Id  System
  18. /dev/sdb1            2048     1026047      512000   8e  Linux LVM
  19. /dev/sdb4         1026048     2097151      535552    5  Extended
  20. /dev/sdb5         1028096     2097151      534528   8e  Linux LVM

  21. Disk /dev/mapper/rhel-root: 18.2 GB, 18249416704 bytes, 35643392 sectors
  22. Units = sectors of 1 * 512 = 512 bytes
  23. Sector size (logical/physical): 512 bytes / 512 bytes
  24. I/O size (minimum/optimal): 512 bytes / 512 bytes


  25. Disk /dev/mapper/rhel-swap: 2147 MB, 2147483648 bytes, 4194304 sectors
  26. Units = sectors of 1 * 512 = 512 bytes
  27. Sector size (logical/physical): 512 bytes / 512 bytes
  28. I/O size (minimum/optimal): 512 bytes / 512 bytes


  29. Disk /dev/mapper/vol0-test: 33 MB, 33554432 bytes, 65536 sectors
  30. Units = sectors of 1 * 512 = 512 bytes
  31. Sector size (logical/physical): 512 bytes / 512 bytes
  32. I/O size (minimum/optimal): 512 bytes / 512 bytes


  33. Disk /dev/mapper/vol0-test2: 50 MB, 50331648 bytes, 98304 sectors
  34. Units = sectors of 1 * 512 = 512 bytes
  35. Sector size (logical/physical): 512 bytes / 512 bytes
  36. I/O size (minimum/optimal): 512 bytes / 512 bytes

  37. [root@station60 ~]# cat /proc/partitions
  38. major minor  #blocks  name

  39.    8        0   20971520 sda
  40.    8        1    1048576 sda1
  41.    8        2   19921920 sda2
  42.    8       16    1048576 sdb
  43.    8       17     512000 sdb1
  44.    8       20          1 sdb4
  45.    8       21     534528 sdb5
  46.   11        0    4391936 sr0
  47. 253        0   17821696 dm-0
  48. 253        1    2097152 dm-1
  49. 253        2      32768 dm-2
  50. 253        3      49152 dm-3
  51. [root@station60 ~]# pvs
  52.   PV         VG   Fmt  Attr PSize   PFree  
  53.   /dev/sda2  rhel lvm2 a--  <19.00g      0
  54.   /dev/sdb1       lvm2 ---  500.00m 500.00m
  55.   /dev/sdb5  vol0 lvm2 a--  512.00m 432.00m
  56. [root@station60 ~]# vgs
  57.   VG   #PV #LV #SN Attr   VSize   VFree  
  58.   rhel   1   2   0 wz--n- <19.00g      0
  59.   vol0   1   2   0 wz--n- 512.00m 432.00m
  60. [root@station60 ~]# lvs
  61.   LV    VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  62.   root  rhel -wi-ao---- <17.00g                                                   
  63.   swap  rhel -wi-ao----   2.00g                                                   
  64.   test  vol0 -wi-a-----  32.00m                                                   
  65.   test2 vol0 -wi-a-----  48.00m                                                   
  66. [root@station60 ~]# vgdisplay vol0
  67.   --- Volume group ---
  68.   VG Name               vol0
  69.   System ID            
  70.   Format                lvm2
  71.   Metadata Areas        1
  72.   Metadata Sequence No  5
  73.   VG Access             read/write
  74.   VG Status             resizable
  75.   MAX LV                0
  76.   Cur LV                2
  77.   Open LV               0
  78.   Max PV                0
  79.   Cur PV                1
  80.   Act PV                1
  81.   VG Size               512.00 MiB
  82.   PE Size               16.00 MiB
  83.   Total PE              32
  84.   Alloc PE / Size       5 / 80.00 MiB
  85.   Free  PE / Size       27 / 432.00 MiB
  86.   VG UUID               D9muED-xgR5-rLEx-3aUg-LCe4-T3OZ-YFBP5T
  87.    
  88. [root@station60 ~]# pvs
  89.   PV         VG   Fmt  Attr PSize   PFree  
  90.   /dev/sda2  rhel lvm2 a--  <19.00g      0
  91.   /dev/sdb1       lvm2 ---  500.00m 500.00m
  92.   /dev/sdb5  vol0 lvm2 a--  512.00m 432.00m
  93. [root@station60 ~]# pvremove /dev/sdb5
  94.   PV /dev/sdb5 is used by VG vol0 so please use vgreduce first.
  95.   (If you are certain you need pvremove, then confirm by using --force twice.)
  96.   /dev/sdb5: physical volume label not removed.
  97. [root@station60 ~]# vgextend  vol0 /dev/sdb1
  98.   Volume group "vol0" successfully extended
  99. [root@station60 ~]# vgreduce vol0  /dev/sdb5
  100.   Physical volume "/dev/sdb5" still in use
  101. [root@station60 ~]# lvs
  102.   LV    VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  103.   root  rhel -wi-ao---- <17.00g                                                   
  104.   swap  rhel -wi-ao----   2.00g                                                   
  105.   test  vol0 -wi-a-----  32.00m                                                   
  106.   test2 vol0 -wi-a-----  48.00m                                                   
  107. [root@station60 ~]#
复制代码
同时观察以下终端:
  1. [root@station60 ~]# vgs vol0
  2.   VG   #PV #LV #SN Attr   VSize   VFree  
  3.   vol0   1   2   0 wz--n- 512.00m 432.00m
  4. [root@station60 ~]# vgs vol0
  5.   VG   #PV #LV #SN Attr   VSize    VFree  
  6.   vol0   2   2   0 wz--n- 1008.00m 928.00m
  7. [root@station60 ~]#
复制代码
解决办法:1. 挪走pv上面的数据(pvmove)
2. 缩小vg
3. pvremove
  1. [root@station60 ~]# pvmove /dev/sdb5 /dev/sdb1
  2.   /dev/sdb5: Moved: 40.00%
  3.   /dev/sdb5: Moved: 100.00%
  4. [root@station60 ~]# pvs
  5.   PV         VG   Fmt  Attr PSize   PFree  
  6.   /dev/sda2  rhel lvm2 a--  <19.00g      0
  7.   /dev/sdb1  vol0 lvm2 a--  496.00m 416.00m
  8.   /dev/sdb5  vol0 lvm2 a--  512.00m 512.00m
  9. [root@station60 ~]# vgreduce  vol0 /dev/sdb5
  10.   Removed "/dev/sdb5" from volume group "vol0"
  11. [root@station60 ~]# pvs
  12.   PV         VG   Fmt  Attr PSize   PFree  
  13.   /dev/sda2  rhel lvm2 a--  <19.00g      0
  14.   /dev/sdb1  vol0 lvm2 a--  496.00m 416.00m
  15.   /dev/sdb5       lvm2 ---  522.00m 522.00m
  16. [root@station60 ~]# pvremove /dev/sdb5
  17.   Labels on physical volume "/dev/sdb5" successfully wiped.
  18. [root@station60 ~]#
复制代码
扩大逻辑卷和文件系统:
Last login: Tue Apr 16 08:53:35 2019
[root@station60 ~]# pvs
  PV         VG   Fmt  Attr PSize   PFree
  /dev/sda2  rhel lvm2 a--  <19.00g      0
  /dev/sdb1  vol0 lvm2 a--  496.00m 496.00m
  /dev/sdb5  vol0 lvm2 a--  512.00m 432.00m
[root@station60 ~]# vgs
  VG   #PV #LV #SN Attr   VSize    VFree
  rhel   1   2   0 wz--n-  <19.00g      0
  vol0   2   2   0 wz--n- 1008.00m 928.00m
[root@station60 ~]# lvs
  LV    VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Conv                                                                             ert
  root  rhel -wi-ao---- <17.00g                                                                                                                              
  swap  rhel -wi-ao----   2.00g                                                                                                                              
  test  vol0 -wi-ao----  32.00m                                                                                                                              
  test2 vol0 -wi-ao----  48.00m                                                                                                                              
[root@station60 ~]# lvextend -L 320M /dev/vol0/test
  Size of logical volume vol0/test changed from 32.00 MiB (2 extents) to 320.00                                                                              MiB (20 extents).
  Logical volume vol0/test successfully resized.
[root@station60 ~]# df -h
Filesystem              Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root    17G  3.7G   14G  22% /
devtmpfs                894M     0  894M   0% /dev
tmpfs                   910M     0  910M   0% /dev/shm
tmpfs                   910M   11M  900M   2% /run
tmpfs                   910M     0  910M   0% /sys/fs/cgroup
/dev/sda1              1014M  178M  837M  18% /boot
/dev/mapper/vol0-test2   45M  2.6M   43M   6% /b
/dev/mapper/vol0-test    27M   27M     0 100% /a
tmpfs                   182M  8.0K  182M   1% /run/user/42
tmpfs                   182M     0  182M   0% /run/user/0
[root@station60 ~]# resize2fs  /dev/vol0/test
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/vol0/test is mounted on /a; on-line resizing required
old_desc_blocks = 1, new_desc_blocks = 3
The filesystem on /dev/vol0/test is now 327680 blocks long.

[root@station60 ~]# df -h
Filesystem              Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root    17G  3.7G   14G  22% /
devtmpfs                894M     0  894M   0% /dev
tmpfs                   910M     0  910M   0% /dev/shm
tmpfs                   910M   11M  900M   2% /run
tmpfs                   910M     0  910M   0% /sys/fs/cgroup
/dev/sda1              1014M  178M  837M  18% /boot
/dev/mapper/vol0-test2   45M  2.6M   43M   6% /b
/dev/mapper/vol0-test   306M   28M  265M  10% /a
tmpfs                   182M  8.0K  182M   1% /run/user/42
tmpfs                   182M     0  182M   0% /run/user/0
[root@station60 ~]# lvextend -L +20M /dev/vol0/test
  Rounding size to boundary between physical extents: 32.00 MiB.
  Size of logical volume vol0/test changed from 320.00 MiB (20 extents) to 352.0                                                                             0 MiB (22 extents).
  Logical volume vol0/test successfully resized.
[root@station60 ~]# resize2fs  /dev/vol0/test
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/vol0/test is mounted on /a; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 3
The filesystem on /dev/vol0/test is now 360448 blocks long.

[root@station60 ~]# df -h
Filesystem              Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root    17G  3.7G   14G  22% /
devtmpfs                894M     0  894M   0% /dev
tmpfs                   910M     0  910M   0% /dev/shm
tmpfs                   910M   11M  900M   2% /run
tmpfs                   910M     0  910M   0% /sys/fs/cgroup
/dev/sda1              1014M  178M  837M  18% /boot
/dev/mapper/vol0-test2   45M  2.6M   43M   6% /b
/dev/mapper/vol0-test   337M   28M  295M   9% /a
tmpfs                   182M  8.0K  182M   1% /run/user/42
tmpfs                   182M     0  182M   0% /run/user/0
[root@station60 ~]# lvextend -l +1 /dev/vol0/test
  Size of logical volume vol0/test changed from 352.00 MiB (22 extents) to 368.0                                                                             0 MiB (23 extents).
  Logical volume vol0/test successfully resized.
[root@station60 ~]# resize2fs  /dev/vol0/test
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/vol0/test is mounted on /a; on-line resizing required
old_desc_blocks = 3, new_desc_blocks = 3
The filesystem on /dev/vol0/test is now 376832 blocks long.

[root@station60 ~]# df -h
Filesystem              Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root    17G  3.7G   14G  22% /
devtmpfs                894M     0  894M   0% /dev
tmpfs                   910M     0  910M   0% /dev/shm
tmpfs                   910M   11M  900M   2% /run
tmpfs                   910M     0  910M   0% /sys/fs/cgroup
/dev/sda1              1014M  178M  837M  18% /boot
/dev/mapper/vol0-test2   45M  2.6M   43M   6% /b
/dev/mapper/vol0-test   353M   28M  310M   9% /a
tmpfs                   182M  8.0K  182M   1% /run/user/42
tmpfs                   182M     0  182M   0% /run/user/0
------------------------------------------------------------------------
xfs 版本:
[root@station60 ~]# df -Th
Filesystem             Type      Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root  xfs        17G  3.7G   14G  22% /
devtmpfs               devtmpfs  894M     0  894M   0% /dev
tmpfs                  tmpfs     910M     0  910M   0% /dev/shm
tmpfs                  tmpfs     910M   11M  900M   2% /run
tmpfs                  tmpfs     910M     0  910M   0% /sys/fs/cgroup
/dev/sda1              xfs      1014M  178M  837M  18% /boot
/dev/mapper/vol0-test2 xfs        45M  2.6M   43M   6% /b
/dev/mapper/vol0-test  ext4      353M   28M  310M   9% /a
tmpfs                  tmpfs     182M   12K  182M   1% /run/user/42
tmpfs                  tmpfs     182M     0  182M   0% /run/user/0
[root@station60 ~]# lvdisplay  /dev/vol0/test2
  --- Logical volume ---
  LV Path                /dev/vol0/test2
  LV Name                test2
  VG Name                vol0
  LV UUID                3TxeHB-gXRj-a1JU-Z05r-ZF4n-AEpI-eqwAzp
  LV Write Access        read/write
  LV Creation host, time station60.example.com, 2019-04-13 10:00:50 -0400
  LV Status              available
  # open                 1
  LV Size                48.00 MiB
  Current LE             3
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:3

[root@station60 ~]# lvdisplay  /dev/mapper/vol0-test2
  --- Logical volume ---
  LV Path                /dev/vol0/test2
  LV Name                test2
  VG Name                vol0
  LV UUID                3TxeHB-gXRj-a1JU-Z05r-ZF4n-AEpI-eqwAzp
  LV Write Access        read/write
  LV Creation host, time station60.example.com, 2019-04-13 10:00:50 -0400
  LV Status              available
  # open                 1
  LV Size                48.00 MiB
  Current LE             3
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     8192
  Block device           253:3

[root@station60 ~]# lvextend -l +1 /dev/vol0/test2
  Size of logical volume vol0/test2 changed from 48.00 MiB (3 extents) to 64.00 MiB (4 extents).
  Logical volume vol0/test2 successfully resized.
[root@station60 ~]# df -Th
Filesystem             Type      Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root  xfs        17G  3.7G   14G  22% /
devtmpfs               devtmpfs  894M     0  894M   0% /dev
tmpfs                  tmpfs     910M     0  910M   0% /dev/shm
tmpfs                  tmpfs     910M   11M  900M   2% /run
tmpfs                  tmpfs     910M     0  910M   0% /sys/fs/cgroup
/dev/sda1              xfs      1014M  178M  837M  18% /boot
/dev/mapper/vol0-test2 xfs        45M  2.6M   43M   6% /b
/dev/mapper/vol0-test  ext4      353M   28M  310M   9% /a
tmpfs                  tmpfs     182M   12K  182M   1% /run/user/42
tmpfs                  tmpfs     182M     0  182M   0% /run/user/0
[root@station60 ~]# xfs_
xfs_admin      xfs_estimate   xfs_info       xfs_metadump   xfs_repair
xfs_bmap       xfs_freeze     xfs_io         xfs_mkfile     xfs_rtcp
xfs_copy       xfs_fsr        xfs_logprint   xfs_ncheck
xfs_db         xfs_growfs     xfs_mdrestore  xfs_quota
[root@station60 ~]# xfs_growfs   /dev/vol0/test2
meta-data=/dev/mapper/vol0-test2 isize=512    agcount=2, agsize=6144 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=1        finobt=0 spinodes=0
data     =                       bsize=4096   blocks=12288, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=1
log      =internal               bsize=4096   blocks=855, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0
data blocks changed from 12288 to 16384
[root@station60 ~]# df -Th
Filesystem             Type      Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root  xfs        17G  3.7G   14G  22% /
devtmpfs               devtmpfs  894M     0  894M   0% /dev
tmpfs                  tmpfs     910M     0  910M   0% /dev/shm
tmpfs                  tmpfs     910M   11M  900M   2% /run
tmpfs                  tmpfs     910M     0  910M   0% /sys/fs/cgroup
/dev/sda1              xfs      1014M  178M  837M  18% /boot
/dev/mapper/vol0-test2 xfs        61M  2.6M   59M   5% /b
/dev/mapper/vol0-test  ext4      353M   28M  310M   9% /a
tmpfs                  tmpfs     182M   12K  182M   1% /run/user/42
tmpfs                  tmpfs     182M     0  182M   0% /run/user/0
[root@station60 ~]#

--------------------------------------------------------------[root@station60 ~]# resize2fs  /dev/vol0/test 40M
resize2fs 1.42.9 (28-Dec-2013)
Filesystem at /dev/vol0/test is mounted on /a; on-line resizing required
resize2fs: On-line shrinking not supported
[root@station60 ~]# umount  /dev/vol0/test
[root@station60 ~]# resize2fs  /dev/vol0/test 40M
resize2fs 1.42.9 (28-Dec-2013)
Please run 'e2fsck -f /dev/vol0/test' first.

[root@station60 ~]# e2fsck -f /dev/vol0/test
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Inode 7, i_blocks is 4050, should be 3990.  Fix<y>? yes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information

/dev/vol0/test: ***** FILE SYSTEM WAS MODIFIED *****
/dev/vol0/test: 12/94208 files (8.3% non-contiguous), 44233/376832 blocks
[root@station60 ~]# e2fsck -yf /dev/vol0/test
e2fsck 1.42.9 (28-Dec-2013)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/vol0/test: 12/94208 files (8.3% non-contiguous), 44233/376832 blocks
[root@station60 ~]# resize2fs  /dev/vol0/test 40M
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/vol0/test to 40960 (1k) blocks.
The filesystem on /dev/vol0/test is now 40960 blocks long.

[root@station60 ~]# lvreduce -L 40M  /dev/vol0/test
  Rounding size to boundary between physical extents: 48.00 MiB.
  WARNING: Reducing active logical volume to 48.00 MiB.
  THIS MAY DESTROY YOUR DATA (filesystem etc.)
Do you really want to reduce vol0/test? [y/n]: y
  Size of logical volume vol0/test changed from 368.00 MiB (23 extents) to 48.00 MiB (3 extents).
  Logical volume vol0/test successfully resized.
[root@station60 ~]# mount  -a
[root@station60 ~]# df -h
Filesystem              Size  Used Avail Use% Mounted on
/dev/mapper/rhel-root    17G  3.7G   14G  22% /
devtmpfs                894M     0  894M   0% /dev
tmpfs                   910M     0  910M   0% /dev/shm
tmpfs                   910M   11M  900M   2% /run
tmpfs                   910M     0  910M   0% /sys/fs/cgroup
/dev/sda1              1014M  178M  837M  18% /boot
/dev/mapper/vol0-test2   61M  2.6M   59M   5% /b
tmpfs                   182M   12K  182M   1% /run/user/42
tmpfs                   182M     0  182M   0% /run/user/0
/dev/mapper/vol0-test    35M   27M  6.0M  82% /a
[root@station60 ~]#-------------------------------------------------------------------------------------------

增量写入快照   但是看快照的时候是不变的

  1. [root@station60 ~]# lvcreate -L 30M -s -n  testsnap  /dev/vol0/test
  2.   Rounding up size to full physical extent 32.00 MiB
  3.   Logical volume "testsnap" created.
  4. [root@station60 ~]# lvs
  5.   LV       VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  6.   root     rhel -wi-ao---- <17.00g                                             
  7.   swap     rhel -wi-ao----   2.00g                                             
  8.   test     vol0 owi-aos---  48.00m                                             
  9.   test2    vol0 -wi-ao----  64.00m                                             
  10.   testsnap vol0 swi-a-s---  32.00m      test   0.04                             
  11. [root@station60 ~]# mkdir /a1
  12. [root@station60 ~]# mount  /dev/vol0/testsnap  /a1
  13. [root@station60 ~]# cd /a
  14. [root@station60 a]# ls
  15. 1.img  lost+found
  16. [root@station60 a]# echo "hello world" >  2.txt
  17. [root@station60 a]# ls
  18. 1.img  2.txt  lost+found
  19. [root@station60 a]# cd /a1
  20. [root@station60 a1]# ls
  21. 1.img  lost+found
  22. [root@station60 a1]#
复制代码
用破坏方法,认清原理:
  1. [root@station60 a1]# cd /a
  2. [root@station60 a]# ls
  3. 1.img  2.txt  lost+found
  4. [root@station60 a]# dd if=/dev/zero of=3.img bs=35M count=1
  5. dd: error writing ‘3.img’: No space left on device
  6. 1+0 records in
  7. 0+0 records out
  8. 7954432 bytes (8.0 MB) copied, 0.397343 s, 20.0 MB/s
  9. [root@station60 a]# df -h
  10. Filesystem                 Size  Used Avail Use% Mounted on
  11. /dev/mapper/rhel-root       17G  3.7G   14G  22% /
  12. devtmpfs                   894M     0  894M   0% /dev
  13. tmpfs                      910M     0  910M   0% /dev/shm
  14. tmpfs                      910M   11M  900M   2% /run
  15. tmpfs                      910M     0  910M   0% /sys/fs/cgroup
  16. /dev/sda1                 1014M  178M  837M  18% /boot
  17. /dev/mapper/vol0-test2      61M  2.6M   59M   5% /b
  18. tmpfs                      182M   12K  182M   1% /run/user/42
  19. tmpfs                      182M     0  182M   0% /run/user/0
  20. /dev/mapper/vol0-test       35M   34M     0 100% /a
  21. /dev/mapper/vol0-testsnap   35M   27M  6.0M  82% /a1
  22. [root@station60 a]# cd /a
  23. [root@station60 a]# lks
  24. bash: lks: command not found...
  25. [root@station60 a]# ls
  26. 1.img  2.txt  3.img  lost+found
  27. [root@station60 a]# rm -rf 1.img
  28. [root@station60 a]# rm -rf 3.img
  29. [root@station60 a]# ls
  30. 2.txt  lost+found
  31. [root@station60 a]# rm 0rf *
  32. rm: cannot remove ‘0rf’: No such file or directory
  33. rm: remove regular file ‘2.txt’? y
  34. rm: cannot remove ‘lost+found’: Is a directory
  35. [root@station60 a]# cd /a1
  36. [root@station60 a1]# ls
  37. 1.img  lost+found
  38. [root@station60 a1]# cd /a
  39. [root@station60 a]# ls
  40. lost+found
  41. [root@station60 a]# dd if=/dev/zero of=3.img bs=35M count=1
  42. dd: error writing ‘3.img’: No space left on device
  43. 1+0 records in
  44. 0+0 records out
  45. 34779136 bytes (35 MB) copied, 0.368419 s, 94.4 MB/s
  46. [root@station60 a]# df -h
  47. Filesystem              Size  Used Avail Use% Mounted on
  48. /dev/mapper/rhel-root    17G  3.7G   14G  22% /
  49. devtmpfs                894M     0  894M   0% /dev
  50. tmpfs                   910M     0  910M   0% /dev/shm
  51. tmpfs                   910M   11M  900M   2% /run
  52. tmpfs                   910M     0  910M   0% /sys/fs/cgroup
  53. /dev/sda1              1014M  178M  837M  18% /boot
  54. /dev/mapper/vol0-test2   61M  2.6M   59M   5% /b
  55. tmpfs                   182M   12K  182M   1% /run/user/42
  56. tmpfs                   182M     0  182M   0% /run/user/0
  57. /dev/mapper/vol0-test    35M   34M     0 100% /a
  58. [root@station60 a]# cd /a
  59. [root@station60 a]# ls
  60. 3.img  lost+found
  61. [root@station60 a]# cd /a1
  62. [root@station60 a1]# ls
  63. [root@station60 a1]# ls
  64. [root@station60 a1]# ls
  65. [root@station60 a1]#
复制代码
同时观察message:












  1. Apr 16 10:04:29 station60 kernel: device-mapper: snapshots: Invalidating snapshot: Unable to allocate exception.
  2. Apr 16 10:04:29 station60 lvm[10050]: WARNING: Snapshot vol0-testsnap changed state to: Invalid and should be removed.
  3. Apr 16 10:04:29 station60 lvm[10050]: Unmounting invalid snapshot vol0-testsnap from /a1.
  4. Apr 16 10:04:29 station60 kernel: Buffer I/O error on dev dm-6, logical block 16385, lost sync page write
  5. Apr 16 10:04:29 station60 kernel: JBD2: Error -5 detected when updating journal superblock for dm-6-8.
  6. Apr 16 10:04:29 station60 kernel: Aborting journal on device dm-6-8.
  7. Apr 16 10:04:29 station60 kernel: Buffer I/O error on dev dm-6, logical block 16385, lost sync page write
  8. Apr 16 10:04:29 station60 kernel: JBD2: Error -5 detected when updating journal superblock for dm-6-8.
  9. Apr 16 10:04:29 station60 kernel: Buffer I/O error on dev dm-6, logical block 1, lost sync page write
  10. Apr 16 10:04:29 station60 kernel: EXT4-fs error (device dm-6): ext4_put_super:800: Couldn't clean up the journal
  11. Apr 16 10:04:29 station60 kernel: EXT4-fs (dm-6): Remounting filesystem read-only
  12. Apr 16 10:04:29 station60 kernel: EXT4-fs (dm-6): previous I/O error to superblock detected
  13. Apr 16 10:04:29 station60 kernel: Buffer I/O error on dev dm-6, logical block 1, lost sync page write
  14. Apr 16 10:04:29 station60 kernel: VFS: Dirty inode writeback failed for block device dm-6 (err=-5).
  15. Apr 16 10:04:29 station60 dmeventd[10050]: No longer monitoring snapshot vol0-testsnap.

复制代码






回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-20 04:50 , Processed in 0.042319 second(s), 24 queries .

快速回复 返回顶部 返回列表