Changeset 1755


Ignore:
Timestamp:
Oct 31, 2007, 1:11:44 AM (12 years ago)
Author:
bruno
Message:

Fix UUID support which was still broken.
Caveat: It can't work for swap partitions as there is no mksap -U option contrary to the -L option for LABEL
So at reboot you won't have swap activated and you'll have to run vol_id -u the_swap_partition to fix your /etc/fstab file

Location:
branches/2.2.5
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2.5/mindi/mindi

    r1737 r1755  
    961961    local res currline partition all_partitions ap_orig remaining i j
    962962
    963     grep -vx " *#.*" $MY_FSTAB | grep -vx " *none.*" | $AWK '/^\/dev\/[imhs]d||^LABEL\=\/|^UUID=/ && !/fdd|cdr|zip|floppy/ {print $1}'
     963    grep -vx " *#.*" $MY_FSTAB | grep -vx " *none.*" | $AWK '/^\/dev\/[imhs]d||^LABEL=\/|^UUID=/ && !/fdd|cdr|zip|floppy/ {print $1}'
    964964    [ -e "/etc/raidtab" ] && $AWK '/^ *device/ {print $2}' /etc/raidtab
    965965    return
     
    12511251    done
    12521252    [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`"
    1253     printf "        %-15s %-15s %-15s %-15s %-15s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)" LABEL UUID | tee -a $LOGFILE
     1253    printf "        %-15s %-15s %-15s %-15s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)" LABEL/UUID | tee -a $LOGFILE
    12541254    useless_dev="/dev/floppy /dev/fd0h1440 /dev/fd0H1440 /dev/cdrom /dev/cdrom/cdrom /dev/cdrom/cdrom1 /dev/cdrom/cdrom2 /dev/cdrom0 /dev/cdrom1 /dev/cdrom2 /dev/cdrom3 /dev/cdrw /dev/scd /dev/ram :/ /dev/sr0 /dev/sr1 /dev/cdrom1"
    12551255    for c_p in $all_partitions ; do
     
    15031503            fi
    15041504        fi
     1505        if [ "$redhat_label" ]; then
     1506            label="$redhat_label"
     1507        else if [ "$uuid" ]; then
     1508            label="$uuid"
     1509        fi
    15051510        partition_format="`echo "$partition_format" | cut -d',' -f1`"; # in case user has ext3,ext2 or something dumb like that
    15061511        [ "$partition_format" = "auto" ] && partition_format="`mount | grep -w $current_partition | $AWK '{print$5;}'`"; # in case user uses 'auto' (dumb!)
    1507         unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s %-15s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label" $uuid`
     1512        unofficial_outstring=`printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label"`
    15081513        if [ "$current_partition" = "" ] ; then
    15091514            echo "Unknown partition (outstring = $unofficial_outstring)" >> $LOGFILE
     
    15121517                partition_mountpt=raid
    15131518                partition_format=raid
    1514                 printf "\t%-15s %-15s %-15s %7s %-15s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label" $uuid | tee -a $LOGFILE
    1515                 printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" $uuid >> $mountlist
     1519                printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label" | tee -a $LOGFILE
     1520                printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist
    15161521            else
    15171522                echo "Unknown mountpoint (outstring = $unofficial_outstring)" >> $LOGFILE
     
    15281533                partition_format="vfat"
    15291534            fi
    1530             printf "\t%-15s %-15s %-15s %7s %-15s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$redhat_label" $uuid | tee -a $LOGFILE
    1531             printf "%s %s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$redhat_label" $uuid >> $mountlist
     1535            printf "\t%-15s %-15s %-15s %7s %-15s\n" $current_partition $partition_mountpt $partition_format $psz "$label" | tee -a $LOGFILE
     1536            printf "%s %s %s %s %s\n" $current_partition $partition_mountpt $partition_format $partition_size "$label" >> $mountlist
    15321537        fi
    15331538    done
  • branches/2.2.5/mondo/src/restore-scripts/mondo/hack-fstab

    r1546 r1755  
    2020    format=`echo "$incoming"     | cut -d' ' -f3`
    2121    size=`echo "$incoming"       | cut -d' ' -f4`
    22     label=`echo "$incoming"       | cut -d' ' -f5`
    23     uuid=`echo "$incoming"       | cut -d' ' -f6`
     22    label=`echo "$incoming"      | cut -d' ' -f5`
    2423    original_fstab_line=`grep " $mountpoint " $old_fstab | grep -v "#" | tr -s ' ' ' '`
    2524    if [ "$format" = "ext2" ] || [ "$format" = "ext3" ] ; then
     
    2827        fi
    2928        if [ "`echo "$original_fstab_line" | grep "UUID="`" != "" ] ; then
    30             device="UUID=$uuid"
     29            device="UUID=$label"
    3130        fi
    3231    fi
  • branches/2.2.5/mondo/src/restore-scripts/mondo/label-partitions-as-necessary

    r1314 r1755  
    1111    label=`echo "$1" | awk '{print $1}' | cut -d'=' -f2`
    1212    format=`echo "$1" | awk '{print $3}'`
     13    mountpt=`awk '{print $1,$5}' $mountlist | grep " $label$" | awk '{print $1}'`
    1314
    1415    if [ "`echo "$1" | grep -E 'LABEL='`" != "" ] ; then
    1516        opttun="-L"
    16         mountpt=`awk '{print $1,$5}' $mountlist | grep " $label$" | awk '{print $1}'`
    1717    elif [ "`echo "$1" | grep -E 'UUID='`" != "" ] ; then
    1818        opttun="-U"
    19         mountpt=`awk '{print $1,$6}' $mountlist | grep " $label$" | awk '{print $1}'`
    2019    else
    2120        # Nothing to do
     
    3534            if [ "$opttun" = "-U" ]; then
    3635                echo "Unable yet to identify swap with UUID"
     36                echo "You'll have to modify your /etc/fstab after reboot"
     37                echo "Replace the UUID found on the swap line by the one"
     38                echo "given by the command vol_id -u $mountpt"
     39                echo "And ask Ubuntu guys to deliver a mswap command with"
     40                echo "a -U option to update the UUID to what we want !!!"
     41
     42                sleep 5
    3743            else
    3844                command="mkswap $opttun $label $mountpt"
Note: See TracChangeset for help on using the changeset viewer.