Ticket #288 (closed defect: fixed)

Opened 2 years ago

Last modified 10 months ago

mindi --makemountlist fails on /etc/fstab with multiple (identical device) entries

Reported by: bwiberg Assigned to: bruno
Priority: normal Milestone: 2.2.9
Component: mindi Version: 2.2.7
Severity: normal Keywords:
Cc:

Description

Multiple entries in /etc/fstab, where the device name (e.g. //server/share) is identical, although the mount points for the two mounts differ, yield an error when calculating the partition size in SizeOfPartition?() of mindi.

Multiple entries may occur e.g. for CIFS if mounting the same share as different users on different mount points.

Attaching suggested patch which assumes that all mounts of a device share a common amount of free space (however, is this true in the case of quotas on shares?).

sprinkle:~# /usr/sbin/mondoarchive -O -9 -d "/mnt/backup/bwiberg/bwiberg/mondorescue" -E "/home /mnt /mnt/backup/bwiberg/bwiberg/mondorescue" -F -i -N -p "sprinkle" -s 4700m -S "/tmp" -T "/tmp" -V
Initializing...
See /var/log/mondoarchive.log for details of backup run.
Checking sanity of your Linux distribution
mindi --makemountlist //mondo.tmp.8b5Lv8/mountlist.txt.test failed for some reas
Please run that command by hand and examine /var/log/mindi.log
for more information. Perhaps your /etc/fstab file is insane.
Perhaps Mindi's MakeMountlist() subroutine has a bug. We'll see.
Failed.
Fatal error... Pre-param initialization phase failed. Please review the error messages above, make the specified changes, then try again. Exiting...
---FATALERROR--- Pre-param initialization phase failed. Please review the error messages above, make the specified changes, then try again. Exiting...
If you require technical support, please contact the mailing list.
See http://www.mondorescue.org for details.
The list's members can help you, if you attach that file to your e-mail.
Log file: /var/log/mondoarchive.log
FYI, I have gzipped the log and saved it to /var/cache/mondo/MA.log.gz.
Mondo has aborted.
Execution run ended; result=254
Type 'less /var/log/mondoarchive.log' to see the output log

So, running mindi manually:

sprinkle:~# mindi --makemountlist /tmp/a.txt
Your mountlist will look like this:
Analyzing LVM...
        DEVICE          MOUNTPOINT      FORMAT          SIZE (MB)       LABEL/UUID
        /dev/sda1       /               ext3              15390
        //192.168.1.2/bwib /home/bwib      cifs             472785
        //192.168.1.2/bwiberg /home/bwiberg   cifs             472785
/usr/sbin/mindi: line 1199: 484131936 484131936/1024: syntaxfel i uttryck (error token is "484131936/1024")

(Translation: "syntax error in expression")

Mindi Linux mini-distro generator v2.0.4-r2045
Latest Mindi is available from http://www.mondorescue.org
BusyBox sources are available from http://www.busybox.net
------------------------------------------------------------------------------
Mindi-BusyBox v1.7.3-r2045 (2008-10-13 00:08:43 CEST) multi-call binary
Do you want to use your own kernel to build the boot disk ([y]/n) ?^CFATAL ERROR. Program is terminating in response to signal received from OS/user
Please e-mail a copy of /var/log/mindi.log to the mailing list.
See http://www.mondorescue.org for more information.
WE CANNOT HELP unless you enclose that file.

sprinkle:~# cat /tmp/a.txt
/dev/sda1 / ext3 15759733
//192.168.1.2/bwib /home/bwib cifs 484131936
//192.168.1.2/bwiberg /home/bwiberg cifs 484131936

(Note how only the two first CIFS entries appear above!)

sprinkle:~# apt-show-versions | grep mondo
^[[Amondo/unknown uptodate 2.2.7
sprinkle:~# apt-show-versions | grep mindi
mindi/unknown uptodate 2.0.4
mindi-busybox/unknown uptodate 1.7.3-1

# /etc/fstab: static file system information.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
proc            /proc           proc    defaults        0       0
/dev/sda1       /               ext3    errors=remount-ro 0       1
//192.168.1.2/bwib      /home/bwib              cifs    iocharset=utf8,nobrl,uid=bwib,gid=bwib,file_mode=0660,dir_mode=0770,username=bwib,password=SECRET             0       0
//192.168.1.2/bwiberg   /home/bwiberg           cifs    iocharset=utf8,nobrl,uid=bwiberg,gid=bwiberg,file_mode=0660,dir_mode=0770,username=bwiberg,password=SECRET    0       0
//192.168.1.2/backup    /mnt/backup/bwib        cifs    iocharset=utf8,nobrl,uid=bwib,gid=bwib,file_mode=0600,dir_mode=0700,username=bwib,password=SECRET             0       0
//192.168.1.2/backup    /mnt/backup/bwiberg     cifs    iocharset=utf8,nobrl,uid=bwiberg,gid=bwiberg,file_mode=0600,dir_mode=0700,username=bwiberg,password=SECRET    0       0
//192.168.1.2/media     /mnt/media              cifs    iocharset=utf8,nobrl,uid=bwiberg,gid=bwiberg,file_mode=0664,dir_mode=0775,username=bwiberg,password=SECRET    0       0

sprinkle:~# df -k
Filsystem             1K-block    Använt Tillgängl Anv% Monterat på
/dev/sda1             15512328   1454092  13270252  10% /
tmpfs                   513760         0    513760   0% /lib/init/rw
udev                     10240        72     10168   1% /dev
tmpfs                   513760         0    513760   0% /dev/shm
//192.168.1.2/bwib   484131936 239106592 245025344  50% /home/bwib
//192.168.1.2/bwiberg
                     484131936 239106592 245025344  50% /home/bwiberg
//192.168.1.2/backup 484131936 239106592 245025344  50% /mnt/backup/bwib
//192.168.1.2/media  484131936 239106592 245025344  50% /mnt/media
//192.168.1.2/backup 484131936 239106592 245025344  50% /mnt/backup/bwiberg
sprinkle:~#

Attachments

mindi.diff (0.7 kB) - added by bwiberg on 11/10/08 00:56:41.
diff -c mindi.dpkg-dist mindi
mindi.log (11.1 kB) - added by bwiberg on 11/10/08 01:04:08.
/var/log/mindi.log
mountlist_after_patch.txt (298 bytes) - added by bwiberg on 11/10/08 01:15:13.
Generated mount list after applying the patch; duplicate mount points…
mondoarchive.log (19.1 kB) - added by bwiberg on 09/28/09 18:25:35.
mondoarchive log 090928
mindi.2.log (11.6 kB) - added by bwiberg on 09/28/09 18:26:02.
mindi log 090928
mindi.txt (33.7 kB) - added by bwiberg on 09/29/09 18:39:25.
set -x output logged from mindi execution
mindi.3.log (11.3 kB) - added by bwiberg on 09/29/09 18:39:50.
fstab (1.0 kB) - added by bwiberg on 09/29/09 18:40:15.
/etc/fstab
mondoarchive.2.log (16.9 kB) - added by bwiberg on 10/07/09 16:14:40.
mondoarchive.log from latest test version

Change History

11/10/08 00:56:41 changed by bwiberg

  • attachment mindi.diff added.

diff -c mindi.dpkg-dist mindi

11/10/08 01:04:08 changed by bwiberg

  • attachment mindi.log added.

/var/log/mindi.log

(in reply to: ↑ description ) 11/10/08 01:08:03 changed by bwiberg

  • version deleted.

Suggested patch is not sufficient; generated mount list will repeat first entry (duplicate mount points). Need a better way to distinguish the fstab lines...

Replying to bwiberg:

Attaching suggested patch which assumes that all mounts of a device share a common amount of free space (however, is this true in the case of quotas on shares?).

11/10/08 01:15:13 changed by bwiberg

  • attachment mountlist_after_patch.txt added.

Generated mount list after applying the patch; duplicate mount points...

11/14/08 15:22:18 changed by bruno

  • status changed from new to assigned.

09/26/09 17:40:41 changed by bruno

  • version set to 2.2.7.
  • milestone set to 2.2.10.

09/28/09 13:57:02 changed by bruno

  • status changed from assigned to closed.
  • resolution set to fixed.
  • milestone changed from 2.2.10 to 2.2.9.

It seems fixed for me on a similar configuration as yours with latest mindi 2.0.7. Let me know for which distribution you'd like packages so that you could test it.

09/28/09 14:47:57 changed by bwiberg

I'm using Debian 5.0 (repositories deb ftp://ftp.mondorescue.org/debian 5.0 contrib, deb-src ftp://ftp.mondorescue.org/debian 5.0 contrib) so Debian 5.0 .deb packages would be great. Thanks in advance!

(Currently I'm using mondo 2.2.9, mindi 2.0.7 and mindi-busybox 1.7.3-1. By the way, mondo-doc does not appear to be available at all from the repository?)

09/28/09 16:43:40 changed by bruno

09/28/09 18:25:01 changed by bwiberg

  • status changed from closed to reopened.
  • resolution deleted.

I installed the two .debs as asked (same version numbers but newer packages?), adjusted /etc/fstab to include the two "similar" mounts, and ran mondoarchive, but it sill bombs, and mindi shows:

sprinkle:~# mindi --makemountlist /tmp/a.txt Your mountlist will look like this: Analyzing LVM...

DEVICE MOUNTPOINT FORMAT SIZE (MB) LABEL/UUID /dev/sda1 / ext3 15390 //192.168.1.2/bwib /home/bwib cifs 472785 //192.168.1.2/bwiberg /home/bwiberg cifs 472785

/usr/sbin/mindi: line 1239: 484131936 484131936/1024: syntaxfel i uttryck (error token is "484131936/1024") Mindi Linux mini-distro generator v2.0.7-r2433M Latest Mindi is available from http://www.mondorescue.org BusyBox? sources are available from http://www.busybox.net


Mindi-BusyBox? v1.7.3-r2045 (2008-10-13 00:08:43 CEST) multi-call binary Do you want to use your own kernel to build the boot disk ([y]/n) ?

(break)

The /tmp/a.txt file shows:

/dev/sda1 / ext3 15759733 //192.168.1.2/bwib /home/bwib cifs 484131936 //192.168.1.2/bwiberg /home/bwiberg cifs 484131936

09/28/09 18:25:35 changed by bwiberg

  • attachment mondoarchive.log added.

mondoarchive log 090928

09/28/09 18:26:02 changed by bwiberg

  • attachment mindi.2.log added.

mindi log 090928

09/28/09 18:27:04 changed by bwiberg

Attached the two new logfiles.

09/29/09 15:25:26 changed by bruno

Using your fstab (that's the only one I can simulate) and with my latest mindi version, I get:

sudo mindi --makemountlist /tmp/2
Your mountlist will look like this:
Analyzing LVM...
        DEVICE          MOUNTPOINT      FORMAT          SIZE (MB)       LABEL/UUID
        /dev/sda1       /               ext3                  0
        //192.168.1.2/bwib /home/bwib      cifs                  0
        //192.168.1.2/bwiberg /home/bwiberg   cifs                  0
        //192.168.1.2/backup /mnt/backup/bwib cifs               cifs 0

        //192.168.1.2/backup /mnt/backup/bwib cifs               cifs 0

        //192.168.1.2/media /mnt/media      cifs                  0
WARNING: Duplicate device entry in mountlist
WARNING: Duplicate mountpoint entry in mountlist

So could you retry again with the new one I just made, and if it still fails, could you edit the /usr/sbin/mindi script and add set -x at the begining, and attach again the resulting logs, which should be more detailed then.

TIA.

09/29/09 18:38:43 changed by bwiberg

I have installed the new versions now, but it still fails.

I'll attach mindi.txt which is the result of:

mindi --makemountlist /tmp/2 2>&1 | tee ~/mindi.txt

...where mindi has "set -x" in it, and /var/log/mindi.log, as well as /etc/fstab. I have replaced the passwords but can assure you that they do not contain any umlaut or special characters.

I also tried unsetting and exporting (empty) LANG, LC_ALL and LC_CTYPE but that did not change anything.

09/29/09 18:39:25 changed by bwiberg

  • attachment mindi.txt added.

set -x output logged from mindi execution

09/29/09 18:39:50 changed by bwiberg

  • attachment mindi.3.log added.

09/29/09 18:40:15 changed by bwiberg

  • attachment fstab added.

/etc/fstab

10/05/09 11:15:54 changed by bruno

Thanks for your help ! I think I've found where the issue was. I made the following change [2448] and regenerated 2 new packages (same place, same name)

(follow-up: ↓ 13 ) 10/05/09 19:12:09 changed by bwiberg

I ran:

mindi --makemountlist /tmp/2

...which resulted in output:

Analyzing LVM...

DEVICE MOUNTPOINT FORMAT SIZE (MB) LABEL/UUID /dev/sda1 / ext3 15390 //192.168.1.2/bwib /home/bwib cifs 472785 //192.168.1.2/bwiberg /home/bwiberg cifs 472785 //192.168.1.2/backup /mnt/backup/bwib cifs cifs 472785

//192.168.1.2/backup /mnt/backup/bwib cifs cifs 472785

//192.168.1.2/media /mnt/media cifs 472785

WARNING: Duplicate device entry in mountlist WARNING: Duplicate mountpoint entry in mountlist

...and generated the following mount list (/tmp/2):

/dev/sda1 / ext3 15759733 //192.168.1.2/bwib /home/bwib cifs 484131936 //192.168.1.2/bwiberg /home/bwiberg cifs 484131936 //192.168.1.2/backup /mnt/backup/bwib cifs cifs 484131936

//192.168.1.2/backup /mnt/backup/bwib cifs cifs 484131936

//192.168.1.2/media /mnt/media cifs 484131936

Notice:

//192.168.1.2/backup /mnt/backup/bwib cifs cifs 472785

//192.168.1.2/backup /mnt/backup/bwib cifs cifs 472785

,..in the output, is that really correct?

Shouldn't it output:

//192.168.1.2/backup /mnt/backup/bwib cifs cifs 472785

//192.168.1.2/backup /mnt/backup/bwiberg cifs cifs 472785

...instead?

Just wanted to alert you regarding this (in case it would create an incorrect fstab because of this).

(in reply to: ↑ 12 ) 10/06/09 12:49:58 changed by bruno

Replying to bwiberg:

Notice: //192.168.1.2/backup /mnt/backup/bwib cifs cifs 472785 //192.168.1.2/backup /mnt/backup/bwib cifs cifs 472785 ,..in the output, is that really correct? Shouldn't it output: //192.168.1.2/backup /mnt/backup/bwib cifs cifs 472785 //192.168.1.2/backup /mnt/backup/bwiberg cifs cifs 472785 ...instead? Just wanted to alert you regarding this (in case it would create an incorrect fstab because of this).

Yes, you're right. It shouldn't give that output. In fact, CIFS mounts should not even be analyzed for the mountlist, as they are just mounted. So they are now excluded (as were NFS mounts) in rev [2452].

I'll provide packages later on, as I was already re-building for another beta round.

10/07/09 07:22:48 changed by bwiberg

OK, thanks, please let me know as soon as the packages are ready and I'll be happy to try them!

10/07/09 09:37:20 changed by bruno

New packages have been delivered (same place, same name for the moment) for you to test and report.

Thanks.

10/07/09 16:04:24 changed by bwiberg

Hello Bruno!

Looks fine now:

sprinkle:~# mount /dev/sda1 on / type ext3 (rw,errors=remount-ro) tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755) proc on /proc type proc (rw,noexec,nosuid,nodev) sysfs on /sys type sysfs (rw,noexec,nosuid,nodev) procbususb on /proc/bus/usb type usbfs (rw) udev on /dev type tmpfs (rw,mode=0755) tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev) devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620) fusectl on /sys/fs/fuse/connections type fusectl (rw) //192.168.1.2/bwib on /home/bwib type cifs (rw) //192.168.1.2/bwiberg on /home/bwiberg type cifs (rw) //192.168.1.2/backup on /mnt/backup/bwiberg type cifs (rw) //192.168.1.2/media on /mnt/media type cifs (rw) //192.168.1.2/backup on /mnt/backup/bwib type cifs (rw)

sprinkle:~# mindi --makemountlist /tmp/2 Your mountlist will look like this: Analyzing LVM...

DEVICE MOUNTPOINT FORMAT SIZE (MB) LABEL/UUID /dev/sda1 / ext3 15390

sprinkle:~#

sprinkle:~# cat /tmp/2 /dev/sda1 / ext3 15759733

Thanks a lot for your help!

10/07/09 16:09:15 changed by bruno

  • status changed from reopened to closed.
  • resolution set to fixed.

10/07/09 16:11:40 changed by bwiberg

  • status changed from closed to reopened.
  • resolution deleted.

Hmm, I ran mondoarchive but now got:

Calling MINDI to create boot+data disks Fatal error... The de facto standard location for your boot loader's config file is /boot/grub/menu.lst /boot/grub/grub.cfg or but I cannot find it there. What is wrong with your Linux distribution? ---FATALERROR--- The de facto standard location for your boot loader's config file is /boot/grub/menu.lst /boot/grub/grub.cfg or but I cannot find it there. What is wrong with your Linux distribution? If you require technical support, please contact the mailing list. See http://www.mondorescue.org for details. The list's members can help you, if you attach that file to your e-mail. Log file: /var/log/mondoarchive.log Mondo has aborted. Execution run ended; result=254 Type 'less /var/log/mondoarchive.log' to see the output log

I'll attach the logs in a minute.

10/07/09 16:12:09 changed by bwiberg

sprinkle:~# ls -la /boot/grub/ totalt 228 drwxr-xr-x 2 root root 4096 6 sep 04.49 . drwxr-xr-x 3 root root 4096 6 sep 04.51 .. -rw-r--r-- 1 root root 197 2 nov 2008 default -rw-r--r-- 1 root root 30 2 nov 2008 device.map -rw-r--r-- 1 root root 8704 2 nov 2008 e2fs_stage1_5 -rw-r--r-- 1 root root 8544 2 nov 2008 fat_stage1_5 -rw-r--r-- 1 root root 9568 2 nov 2008 jfs_stage1_5 -rw-r--r-- 1 root root 3915 6 sep 04.49 menu.lst -rw-r--r-- 1 root root 3915 6 sep 04.49 menu.lst~ -rw-r--r-- 1 root root 7904 2 nov 2008 minix_stage1_5 -rw-r--r-- 1 root root 10720 2 nov 2008 reiserfs_stage1_5 -rw-r--r-- 1 root root 512 2 nov 2008 stage1 -rw-r--r-- 1 root root 128616 2 nov 2008 stage2 -rw-r--r-- 1 root root 10280 2 nov 2008 xfs_stage1_5 sprinkle:~#

10/07/09 16:14:40 changed by bwiberg

  • attachment mondoarchive.2.log added.

mondoarchive.log from latest test version

10/07/09 16:18:56 changed by bruno

Yep , this one was fixed in between :-( Error on my side. New packages need to be done again. On their way to the repo. Expect them there in 15 minutes or so.

10/07/09 17:37:29 changed by bwiberg

Thanks, seems to be working now!

10/08/09 01:01:56 changed by bruno

  • status changed from reopened to closed.
  • resolution set to fixed.