Opened 13 years ago
Closed 12 years ago
#621 closed defect (fixed)
mondoarchive crashes when fstab contains bind mounts
Reported by: | victor gattegno | Owned by: | Bruno Cornec |
---|---|---|---|
Priority: | high | Milestone: | 3.0.3 |
Component: | mindi | Version: | 3.0.1 |
Severity: | major | Keywords: | |
Cc: |
Description
If there are some bind mounts in /etc/fstab, example :
/ora/2/saptrace/usertrace /home/ora/user none bind
Then mondoarchive fails with :
FATAL ERROR. Cannot find /ora/2/saptrace/usertrace's size - is your /etc/fstab sane?
I found where is the problem : mondoarchive crashes because mindi doesn't manage bind mounts in fstab.
At line #2215 /usr/sbin/mindi 2.1.1 checks only "/dev/", as the /etc/fstab mount bind lines don't contain any "/dev", then mindi dies with that fatal error message (mindi 2.1.1 Line #2216).
Attachments (1)
Change History (10)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
Milestone: | 3.0.2 → 3.0.3 |
---|
Now that 3.0.2 is out, please check again adn report back.
comment:3 by , 12 years ago
I tested with the new version of mondo (3.0.2) and mindi (2.1.2) rev 3018 on our SLES 11 test server, the problem is still present.
I emailed the logs directly to Bruno.
comment:5 by , 12 years ago
Status: | new → assigned |
---|
Could you test if the following patch solves the issue:
=== mindi/mindi ================================================================== --- mindi/mindi (revision 4935) +++ mindi/mindi (local) @@ -1069,7 +1069,7 @@ done [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`" printf " %-15s %-15s %-15s %-13s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)" LABEL/UUID | tee -a $LOGFILE - 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" + 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 iso9660" for c_p in $all_partitions ; do # Skip fd/cd devices, network FS, cifs [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | grep -E "^//"`" != "" ]&& continue
comment:6 by , 12 years ago
This patch should cover better the case, in fact by also checking the bind option in fstab:
=== mindi/mindi ================================================================== --- mindi/mindi (revision 4935) +++ mindi/mindi (local) @@ -1069,7 +1069,7 @@ done [ "$IMAGE_DEVS" != "" ] && all_partitions="`echo "$all_partitions $IMAGE_DEVS" | tr ' ' '\n' | sort -u | tr '\n ' ' '`" printf " %-15s %-15s %-15s %-13s %-15s\n" DEVICE MOUNTPOINT FORMAT "SIZE (MB)" LABEL/UUID | tee -a $LOGFILE - 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" + 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 iso9660" for c_p in $all_partitions ; do # Skip fd/cd devices, network FS, cifs [ "`echo "$useless_dev" | grep -F "$c_p"`" != "" ] || [ "`echo "$c_p" | grep ":"`" != "" ] || [ "`echo "$c_p" | grep -E "^//"`" != "" ]&& continue @@ -1091,8 +1091,14 @@ # Detects noauto partitions not mounted and exclude them partition_option=`tr -s '\t' ' ' < $MY_FSTAB | grep -w "$current_partition" | grep -vx " *#.*" | $AWK '{print $4}' | head -n1` if [ "`echo "$partition_option" | grep -i noauto`" != "" ] && [ "`mount | grep -w "$partition_mountpt"`" = "" ] ; then + LogFile "INFO: Excluding $current_partition from mountlist (due to noauto option in fstab)" continue fi + # Detects bind partitions and exclude them + if [ "`echo "$partition_option" | grep -iw bind`" != "" ]; then + LogFile "INFO: Excluding $current_partition from mountlist (due to bind option in fstab)" + continue + fi # set default in case we dont't find it str_to_find_fmt_with=$current_partition
If you can check and report back, that would be great Victor !
comment:7 by , 12 years ago
Thanks Bruno !
I checked it on an Ubuntu 12.04 and it works well, mindi doesn't stop anymore because of bind mount lines in fstab.
With, in fstab :
/home/test1 /home/mounts/t1 none bind /home/test2 /home/mounts/t2 none bind
I get in mindi.log :
Your mountlist will look like this: ----------------------------------- DEVICE MOUNTPOINT FORMAT SIZE (MB) LABEL/UUID ... INFO: Excluding /home/test1 from mountlist (due to bind option in fstab) INFO: Excluding /home/test2 from mountlist (due to bind option in fstab)
But, should these bind mount lines be excluded ?
I was thinking that these bind mounts should be created again automatically at restore time...
Note : I got some problems to patch /usr/sbin/mindi with your patch. I adapted it, please check if the attached mindi is ok (rev number maybe false but I think that the rest is ok).
by , 12 years ago
Attachment: | mindi-20120706-patch_bind added |
---|
mindi 2.1.2 patched with Bruno solution
comment:8 by , 12 years ago
Can you test whether the last mindi 2.1.3 fixes it correctly (after restore we expect to be able to have the bind mount work correctly).
comment:9 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
From mail you sent to me, this specific issue seems to be now solved.
We are excluding bind mounts from the restore period, but as they are still in the original fstab, they should be mounted back, once the restored system is rebooted.
I'm unable to reproduce that problem by adding this line in my /etc/fstab, with the latest rev [3014]:
I get:
So I'm unsure what to do. Worth testing again once 3.0.2 is out.