Upload files to "mdev"
mdev rules for masking origin filesystem UUID
This commit is contained in:
parent
fa9362f147
commit
1a95f201d9
4
mdev/dmcache-uuids
Normal file
4
mdev/dmcache-uuids
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
# Filesystem UUIDs that should be removed from
|
||||||
|
# /dev/disk/by-uuid/
|
||||||
|
# One UUID per row.
|
||||||
|
44b2986e-0799-422a-9fb7-a534bbbc62a0
|
25
mdev/dmcache.mdev
Normal file
25
mdev/dmcache.mdev
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
uuid_file="/etc/dmcache-uuids"
|
||||||
|
|
||||||
|
# Check if the file exists
|
||||||
|
if [ ! -f "$uuid_file" ]; then
|
||||||
|
echo "Error: File '$uuid_file' not found."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Loop through each UUID in the file and remove the corresponding symlink
|
||||||
|
while IFS= read -r uuid; do
|
||||||
|
|
||||||
|
if [ -z "$uuid" ] || [ "${uuid:0:1}" = "#" ]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
symlink="/dev/disk/by-uuid/$uuid"
|
||||||
|
|
||||||
|
# Check if the symlink exists
|
||||||
|
if [ -L "$symlink" ]; then
|
||||||
|
echo "Removing symlink: $symlink"
|
||||||
|
rm "$symlink"
|
||||||
|
fi
|
||||||
|
done < "$uuid_file"
|
Loading…
Reference in New Issue
Block a user