逻辑卷挂载在/mnt下,快照挂载在/media下


创建大小为100M快照

# lvcreate -s -p r -L 100M -n lvtest_snap /dev/myvg/lvtest 

  Rounding up size to full physical extent 112.00 MB

  Logical volume "lvtest_snap" created


# mount /dev/myvg/lvtest_snap /media/

mount: block device /dev/myvg/lvtest_snap is write-protected, mounting read-only


创建大小为10M的文件

# dd if=/dev/zero of=/mnt/bigfile bs=1M count=10

创建前

# lvs

  LV          VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert

  lvtest      myvg owi-ao   3.00G                                      

  lvtest_snap myvg sri-ao 112.00M lvtest   0.03                   

创建后,快照有所增长

# lvs

  LV          VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert

  lvtest      myvg owi-ao   3.00G                                      

  lvtest_snap myvg sri-ao 112.00M lvtest   9.07                        


继续创建大文件

# dd if=/dev/zero of=/mnt/bigfile2 bs=1M count=10

# dd if=/dev/zero of=/mnt/bigfile2 bs=1M count=100


快照损坏

# lvs

  /dev/myvg/lvtest_snap: read failed after 0 of 4096 at 3221159936: Input/output error

  /dev/myvg/lvtest_snap: read failed after 0 of 4096 at 3221217280: Input/output error

  /dev/myvg/lvtest_snap: read failed after 0 of 4096 at 0: Input/output error

  /dev/myvg/lvtest_snap: read failed after 0 of 4096 at 4096: Input/output error

  LV          VG   Attr   LSize   Origin Snap%  Move Log Copy%  Convert

  lvtest      myvg owi-ao   3.00G                                      

  lvtest_snap myvg Sri-I- 112.00M lvtest 100.00


df -h看到刚才挂载到/media下的快照,没有了,并且无法挂载




来自为知笔记(Wiz)