Changeset 3726 in MondoRescue


Ignore:
Timestamp:
Nov 11, 2019, 11:59:48 PM (5 years ago)
Author:
Bruno Cornec
Message:

Fix #852 by using btrfstune

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mondo/src/restore-scripts/mondo/mr-label-partitions-as-necessary

    r3574 r3726  
    77
    88read_partition_line() {
    9     local label mountpt command format device d m
     9    local label mountpt command format device d m dev
    1010
    11     device=`echo "$1" | awk '{print $1}'`
    12     d=`echo "$device" | cut -c1`
     11    dev=`echo "$1" | awk '{print $1}'`
     12    d=`echo "$dev" | cut -c1`
    1313    format=`echo "$1" | awk '{print $3}'`
    14     label=`echo "$device" | cut -s -d'=' -f2`
     14    label=`echo "$dev" | cut -s -d'=' -f2`
    1515    if [ "$d" = "/" ] && [ "$label" = "" ]; then
    1616        m=`echo "$1" | awk '{print $2}'`
     
    4848            $command
    4949        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"
     50            echo "$1" | awk '{print $4}' | grep -q 'subvol='
     51            if [ $? -eq 0 ]; then
     52                LogIt "Nothing to do on btrfs subvol"
     53                return
     54            fi
     55            if [ "$opttun" = "-U" ]; then
     56                # Also see https://btrfs.wiki.kernel.org/index.php/Project_ideas#Filesystem_UUID_change_-_off-line
     57                device=`awk '{print $1,$5}' $mountlist | grep -E " $label" | awk '{print $1}'`
     58                command="btrfstune $opttun $label $device"
     59            else
     60                command="btrfs filesystem label $mountpt $label"
     61            fi
    5262            LogIt "Running $command"
    5363            $command
Note: See TracChangeset for help on using the changeset viewer.