0

I am using SLES 11 SP3. When I run df -lh in order to see mounted filesystems I get following results, which are correct:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb3       9.9G  2.9G  6.5G  31% /
udev             32G  240K   32G   1% /dev
/dev/sdb1       156M   12M  145M   8% /boot/efi
/dev/sdb4       100G   11G   90G  11% /home
/dev/sdb5       383G   33M  383G   1% /data1
/dev/sda1       2.2T  5.3G  2.2T   1% /data2
/dev/sda2       2.4T   34M  2.4T   1% /data3

When I reboot the server, and run the same command again, I get following results:

Filesystem      Size  Used Avail Use% Mounted on
/dev/sdb3       9.9G  2.9G  6.5G  31% /
udev             32G  240K   32G   1% /dev
/dev/sdb1       9.9G  2.9G  6.5G  31% /boot/efi
/dev/sdb4       9.9G  2.9G  6.5G  31% /home
/dev/sdb5       9.9G  2.9G  6.5G  31% /data1
/dev/sda1       9.9G  2.9G  6.5G  31% /data2
/dev/sda2       9.9G  2.9G  6.5G  31% /data3

Clearly, details of / are copied for other mounts.

To deal with this, I created a script and kept it in /etc/rc.d/rc3.d. The script is as follows:

#!/bin/ksh

PATH=/usr/sbin:/usr/bin:/bin

/bin/umount /home /data1 /data2 /data3 /boot/efi; sleep 2; /bin/mount -a

Now, with the script kept in /etc/rc.d/rc3.d, I rebooted the server and run df -lh and it showed correct results.

/etc/fstab contents:

/dev/disk/by-id/scsi-3600508e0000000000f6ecbedd51a340e-part1    /boot/efi            vfat       umask=0002,utf8=true    0 0
/dev/disk/by-id/scsi-3600508e0000000000f6ecbedd51a340e-part2    swap                 swap       defaults                0 0
/dev/disk/by-id/scsi-3600508e0000000000f6ecbedd51a340e-part3    /                    ext3       acl,user_xattr          0 0
/dev/disk/by-id/scsi-3600508e0000000000f6ecbedd51a340e-part4    /home                xfs        defaults                0 0
/dev/disk/by-id/scsi-3600508e0000000000f6ecbedd51a340e-part5    /data1               xfs        defaults                0 0
/dev/disk/by-id/scsi-3600605b006a1b3a01cf0a6ee20e4a325-part1    /data2               xfs        defaults                0 0
/dev/disk/by-id/scsi-3600605b006a1b3a01cf0a6ee20e4a325-part2    /data3               xfs        defaults                0 0
proc                                                            /proc                proc       defaults                0 0
sysfs                                                           /sys                 sysfs      noauto                  0 0
debugfs                                                         /sys/kernel/debug    debugfs    noauto                  0 0
usbfs                                                           /proc/bus/usb        usbfs      noauto                  0 0
devpts                                                          /dev/pts             devpts     mode=0620,gid=5         0 0
  1. Why am I getting wrong stats every time I reboot the machine?
  2. Is there any package/patch to resolve this problem?
4
  • 1
    Post the contents of your /etc/fstab file. – Andrew Henle Jun 1 '15 at 11:47
  • @AndrewHenle- Updated in the question. I have tried with UUID and device name, but no effects. – Mandar Shinde Jun 1 '15 at 12:05
  • Per the fstab man page (linux.die.net/man/5/fstab): "The sixth field, (fs_passno), is used by the fsck(8) program to determine the order in which filesystem checks are done at reboot time. The root filesystem should be specified with a fs_passno of 1, and other filesystems should have a fs_passno of 2." Yes, it says it's for fsck, but I'd try that for all your regular on-disk file systems. – Andrew Henle Jun 1 '15 at 13:32
  • Please post the output of ls -l /etc/mtab; cat /etc/mtab; echo ----; cat /proc/mounts before running the umount lines. – Gilles 'SO- stop being evil' Jun 1 '15 at 22:00
1

I'm not specifically familiar with SLES11 SP3, but filesystems are automatically mounted from /etc/fstab at boot time (depending on options found there). What you're seeing looks like mounts are being added to the mount table but they're not succeeding so the status for the parent filesystem is being used (which is "/" in your example).

I would run the mount command by itself both when df shows the correct output and when it doesn't. Then I'd compare the two by picking one entry (such as /boot/efi) and checking for differences. The next step would depend on what I find.

Ah, you updated your OP with the contents of your /etc/fstab and I see that all of the partitions are on SCSI drives. It's likely that the SCSI subsystem hasn't been fully configured by the time the mount commands are issued. Moving the mounts to a later point in the boot sequence would likely correct the problem.

It's also possible that the xfs and vfat modules are not available by the time the mounts are attempted either. This is common if you added the XFS partitions after the last time the initrd was generated (either by mkinitrd or dracut; I'm not sure which one SLES11 SP3 uses). Those programs scan your running system for kernel modules that are then added to the startup script so that those modules are loaded very early in the boot process. I recall that RHEL has a configuration file under /etc/sysconfig/ where certain modules can be forced to load (such as xfs and vfat) but you may not need them if you rebuild the initrd while the filesystems are properly mounted.

1
  • Yes. There is a stark difference. When df shows wrong details, mount output does not show anything related to those filesystems (like /boot/efi or /data1). But, when I run the script, mount output has the entries for all of them. – Mandar Shinde Jun 1 '15 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.