Changeset 3702 in MondoRescue for branches


Ignore:
Timestamp:
Apr 11, 2018, 2:05:18 AM (6 years ago)
Author:
Bruno Cornec
Message:
  • Fix #838 by skipping subvol fstab lines for the mountlist
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.3/mindi/mindi

    r3697 r3702  
    829829
    830830ListAllPartitions() {
    831     grep -Evx " *#.*| *none.*" $MY_FSTAB | $AWK '/^\/dev\/[imhs]d||^LABEL=\/|^UUID=/ && !/\/fdd|\/cdr|\/zip|\/floppy/ {print $1}'
     831    grep -Evx " *#.*| *none.*" $MY_FSTAB | $AWK '/^\/dev\/[imhs]d||^LABEL=\/|^UUID=/ && !/\/fdd|\/cdr|\/zip|\/floppy/ {print $1}' | sort -u
    832832    [ -e "/etc/raidtab" ] && $AWK '/^ *device/ {print $2}' /etc/raidtab
    833833    if [ -e "/vmfs/volumes" ]; then
     
    10731073    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 tmpfs devpts sysfs proc debugfs"
    10741074    for c_p in $all_partitions ; do
    1075         # Skip fd/cd devices, network FS, cifs
     1075        # Skip fd/cd devices, network FS, cifs, brtfs subvols
    10761076        [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | grep -E "^//"`" != "" ]&& continue
    10771077        [ "`echo "$c_p" | grep -x "/dev/cdroms.*"`" ] && continue
     
    10891089        fi
    10901090        [ "$c_p" = "none" ] && continue
     1091
    10911092        redhat_label=""
    10921093        label=""
     
    12531254        fi
    12541255
     1256        # Avoid analyzing btrfs subvol partitions
     1257        partition_option=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$str_to_find_fmt_with" | grep -vx " *#.*" | $AWK '{print $4}' | grep -v 'subvol=' | head -n1`
    12551258        # Detects noauto partitions not mounted and exclude them
    1256         partition_option=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$str_to_find_fmt_with" | grep -vx " *#.*" | $AWK '{print $4}' | head -n1`
    12571259        if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" =  "" ] ; then
    1258                 LogFile "INFO: Excluding $current_partition from mountlist (due to noauto option in fstab)"
     1260            LogFile "INFO: Excluding $current_partition from mountlist (due to noauto option in fstab)"
    12591261            continue
    12601262        fi
    12611263        # Detects bind partitions and exclude them
    12621264        if [ "`echo "$partition_option" | grep -iw bind`" != "" ]; then
    1263                 LogFile "INFO: Excluding $current_partition from mountlist (due to bind option in fstab)"
     1265            LogFile "INFO: Excluding $current_partition from mountlist (due to bind option in fstab)"
    12641266            continue
    12651267        fi
     
    12921294        fi
    12931295
    1294         partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB`
     1296        # sort in case of btrfs subvol
     1297        partition_format=`$AWK '$1 == "'"$str_to_find_fmt_with"'" {print $3}' $MY_FSTAB | sort -u`
    12951298        # Detects iso9660 ISO images and exclude them
    12961299        if [ "`echo "$partition_format" | grep -iw iso9660`" != "" ]; then
Note: See TracChangeset for help on using the changeset viewer.