Guest User

Untitled

a guest
Nov 18th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.19 KB | None | 0 0
  1. --- /usr/share/initramfs-tools/scripts/local-top/lvm2 2009-08-17 19:28:09.000000000 +0200
  2. +++ /usr/share/initramfs-tools/scripts/local-top/lvm2 2010-02-19 23:22:14.000000000 +0100
  3. @@ -45,12 +45,30 @@
  4.  
  5. eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev")
  6.  
  7. - if [ "$DM_VG_NAME" ] && [ "$DM_LV_NAME" ]; then
  8. - lvm lvchange -aly --ignorelockingfailure "$DM_VG_NAME/$DM_LV_NAME"
  9. - rc=$?
  10. - if [ $rc = 5 ]; then
  11. - echo "Unable to find LVM volume $DM_VG_NAME/$DM_LV_NAME"
  12. - fi
  13. + # Make sure that we have non-empty volume group and logical volume
  14. + if [ -z "$DM_VG_NAME" ] || [ -z "$DM_LV_NAME" ]; then
  15. + return 1
  16. + fi
  17. +
  18. + # If the logical volume hasn't shown up yet, give it a little while
  19. + # to deal with LVM on removable devices (inspired from scripts/local)
  20. + fulldev="/dev/$DM_VG_NAME/$DM_LV_NAME"
  21. + if [ -z "`lvm lvscan -a --ignorelockingfailure |grep $fulldev`" ]; then
  22. + # Use default root delay
  23. + slumber=$(( ${ROOTDELAY:-180} * 10 ))
  24. +
  25. + while [ -z "`lvm lvscan -a --ignorelockingfailure |grep $fulldev`" ]; do
  26. + /bin/sleep 0.1
  27. + slumber=$(( ${slumber} - 1 ))
  28. + [ ${slumber} -gt 0 ] || break
  29. + done
  30. + fi
  31. +
  32. + # Activate logical volume
  33. + lvm lvchange -aly --ignorelockingfailure "$DM_VG_NAME/$DM_LV_NAME"
  34. + rc=$?
  35. + if [ $rc = 5 ]; then
  36. + echo "Unable to find LVM volume $DM_VG_NAME/$DM_LV_NAME"
  37. fi
  38. }
  39.  
  40. #!/bin/sh
  41.  
  42. case "$1" in
  43. start)
  44. /sbin/vgscan
  45. /sbin/vgchange -ay
  46. ;;
  47. stop)
  48. /sbin/vgchange -an
  49. ;;
  50. restart|force-reload)
  51. ;;
  52. esac
  53.  
  54. exit 0
  55.  
  56. diff -u /usr/share/initramfs-tools/scripts/local-top/lvm2-backup /usr/share/initramfs-tools/scripts/local-top/lvm2
  57. --- /usr/share/initramfs-tools/scripts/local-top/lvm2-backup 2014-06-06 19:55:19.249857946 -0400
  58. +++ /usr/share/initramfs-tools/scripts/local-top/lvm2 2014-06-21 01:26:01.015289945 -0400
  59. @@ -60,6 +60,7 @@
  60.  
  61. modprobe -q dm-mod
  62.  
  63. +lvm vgchange -ay
  64. activate_vg "$ROOT"
  65. activate_vg "$resume"
  66.  
  67. $ sudo vgscan
  68. [sudo] password for username:
  69. Reading all physical volumes. This may take a while...
  70. Found volume group "vg02" using metadata type lvm2
  71. Found volume group "vg00" using metadata type lvm2
  72.  
  73. $ sudo vgchange -ay /dev/vg02
  74. 7 logical volume(s) in volume group "vg00" now active
Add Comment
Please, Sign In to add comment