Changeset 3330 in MondoRescue for branches/3.2/mondo/src/restore-scripts
- Timestamp:
- Dec 23, 2014, 7:49:06 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mondo/src/restore-scripts/mondo/label-partitions-as-necessary
r3328 r3330 7 7 8 8 read_partition_line() { 9 local label mountpt command format 9 local label mountpt command format device d m 10 10 11 label=`echo "$1" | awk '{print $1}' | cut -d'=' -f2` 11 device=`echo "$1" | awk '{print $1}'` 12 d=`echo "$device" | cut -c1` 12 13 format=`echo "$1" | awk '{print $3}'` 14 label=`echo "$device" | cut -s -d'=' -f2` 15 if [ "$d" = "/" ] && [ "$label" = "" ]; then 16 m=`echo "$1" | awk '{print $2}'` 17 # We force UUID even if nothing in fstab as some new distro like RHEL7 rely on it 18 [ "$format" = "reiserfs" ] && opttun="-u" || opttun="-U" 19 label=`awk '{print $2,$5}' $mountlist | grep -E "^$m " | awk '{print $2}'` 20 else 21 if [ "`echo "$1" | grep -E 'LABEL='`" != "" ] ; then 22 [ "$format" = "reiserfs" ] && opttun="-l" || opttun="-L" 23 elif [ "`echo "$1" | grep -E 'UUID='`" != "" ] ; then 24 [ "$format" = "reiserfs" ] && opttun="-u" || opttun="-U" 25 else 26 LogIt "Nothing to do on $1" 27 return 28 fi 29 fi 13 30 mountpt=`awk '{print $1,$5}' $mountlist | grep " $label$" | awk '{print $1}'` 14 15 if [ "`echo "$1" | grep -E 'LABEL='`" != "" ] ; then16 [ "$format" = "reiserfs" ] && opttun="-l" || opttun="-L"17 elif [ "`echo "$1" | grep -E 'UUID='`" != "" ] ; then18 [ "$format" = "reiserfs" ] && opttun="-u" || opttun="-U"19 else20 LogIt "Nothing to do on $1"21 return22 fi23 31 24 32 if [ ! "$mountpt" ] ; then 25 33 LogIt "Not labeling anything as ($label) because ($mountpt) is not a mountpoint" 26 34 elif [ ! "$label" ] ; then 27 LogIt "Not labeling ($mountpt) as anything because ($label) is not a label "35 LogIt "Not labeling ($mountpt) as anything because ($label) is not a label/uuid" 28 36 else 29 37 if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] || [ "$format" = "ext4" ]; then … … 37 45 elif [ "$format" = "reiserfs" ]; then 38 46 command="reiserfstune $opttun $label $mountpt" 47 LogIt "Running $command" 48 $command 49 elif [ "$format" = "btrfs" ]; then 50 # Also see https://btrfs.wiki.kernel.org/index.php/Project_ideas#Filesystem_UUID_change_-_off-line 51 command="btrfs filesystem label $mountpt $label" 39 52 LogIt "Running $command" 40 53 $command
Note:
See TracChangeset
for help on using the changeset viewer.