Code: Alles auswählen
root@kvm23-4:/# blkid /dev/LVM/foo
/dev/LVM/foo: UUID="8031bed3-a8bc-4b7f-81aa-0805ddc3ed2a" TYPE="ext4"
Richtig toll wäre es, wenn es auch ein Tool gibt, womit das wieder ausgetragen werden kann.
Grüße,
Patrick-Oliver
Code: Alles auswählen
root@kvm23-4:/# blkid /dev/LVM/foo
/dev/LVM/foo: UUID="8031bed3-a8bc-4b7f-81aa-0805ddc3ed2a" TYPE="ext4"
Code: Alles auswählen
# awk -v dev=/dev/LVM/foo '$1==dev' /proc/mounts >>/etc/fstab
Code: Alles auswählen
# t="$(mktemp)"
# awk -v dev=/dev/LVM/foo '$1!=dev' </etc/fstab >"$t"
# cat "$t" >/etc/fstab
# rm -rf "$t"; t=
If universal surveillance were the answer, lots of us would have moved to the former East Germany. If surveillance cameras were the answer, camera-happy London, with something like 500,000 of them at a cost of $700 million, would be the safest city on the planet.
—Bruce Schneier
Code: Alles auswählen
...
# write to $FSTAB
UUID=$(blkid "$DEV/$1" | perl -lne '/UUID=\"(.+?)\"/;print $1;')
if grep "$UUID" "$FSTAB" > /dev/null 2>&1 \
|| grep "$IMAGES/$1" "$FSTAB" > /dev/null 2>&1 \
|| ! pushLineToFile "UUID=$UUID\t$IMAGES/$1\text4\tdefaults\t0\t2" "$FSTAB"; then
sed -i "\:$IMAGES/$1:d" "$FSTAB"
fi
...
Code: Alles auswählen
sed -i "\:$IMAGES/$1:d" "$FSTAB"