Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. touch /home/liveuser/Desktop/resize.sh
  2. cat > /home/liveuser/Desktop/resize.sh <<EOF
  3. lvchange -a y
  4. ROOTVOL=/dev/mapper/vg_blago-lv_root
  5. mkdir /tmp/lvroot
  6. mount -t ext4 -o ro $ROOTVOL /tmp/lvroot
  7. usedROOT=$(df -h $ROOTVOL | tail -1 | awk '{print $2}' | awk '{printf("%dn",$1 + 1)}')
  8. umount /tmp/rootvol
  9. /sbin/lvresize --resizefs --size $usedROOTg $ROOTVOL
  10. e2fsck $ROOTVOL
  11. sleep 1
  12. # reduce home volume
  13. HOMEVOL=/dev/mapper/vg_blago-lv_home
  14. mkdir /tmp/lvhome
  15. mount -t ext4 -o ro $HOMEVOL /tmp/lvhome
  16. usedROOT=$(df -h $HOMEVOL | tail -1 | awk '{print $2}' | awk '{printf("%dn",$1 + 1)}')
  17. umount /tmp/lvhome
  18. e2fsck $HOMEVOL
  19. EOF
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement