Created
December 26, 2010 11:01
-
-
Save kamawanu/755352 to your computer and use it in GitHub Desktop.
append fstab from current mount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
# https://gist.github.com/755352 | |
for DEV in $( mount | awk '{print $1}'|fgrep /dev/ ) | |
do | |
PUREDEV=$( echo $DEV | cut -d/ -f3- ) | |
UUIDIS=$( ls -l /dev/disk/by-uuid/ | fgrep $PUREDEV | awk '{print $8}' ) | |
fgrep $UUIDIS /etc/fstab || ( | |
echo $UUIDIS | |
echo UUID=$UUIDIS $( mount | fgrep $PUREDEV | awk '{print $3,$5}') defaults,noatime 0 0 | sudo tee -a /etc/fstab | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment