Advertisement
Guest User

Untitled

a guest
Feb 6th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #!/bin/bash
  2. tmpfile=/tmp/tmpreadblkid
  3. blkid | grep "LABEL" > ${tmpfile}
  4.  
  5. sed -ri -e 's/.*LABEL=//g' -e 's/UUID=//g' -e 's/"//g' -e 's/TYPE.*//g' ${tmpfile}
  6.  
  7. while read p; do
  8. label=$(echo ${p} | cut -f1 -d' ')
  9. uuid=$(echo ${p} | cut -f2 -d' ')
  10. echo ${label}
  11. echo ${uuid}
  12. ln -s /dev/disk/by-uuid/${uuid} /mnt/${label}
  13. done <${tmpfile}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement