News:

Rule #1 - Be Patient - Rule #2 - Don't ask when, if you don't contribute - Rule #3 - You have coding skills - LinuxMCE's small brother is available: http://www.agocontrol.com

Main Menu

Disk is umounted and remounted a few times a minute

Started by chrisbirkinshaw, December 03, 2007, 09:00:49 PM

Previous topic - Next topic

chrisbirkinshaw

My second internal hard drive in the core is unmounted and remounted a few times a minute. Anyone else seen this?

From /var/log/messages:

Dec  3 19:35:09 dcerouter kernel: [351708.768290] EXT3 FS on hdb1, internal journal
Dec  3 19:35:31 dcerouter kernel: [351731.241902] EXT3 FS on hdb1, internal journal
Dec  3 19:35:34 dcerouter kernel: [351734.583380] EXT3 FS on hdb1, internal journal
Dec  3 19:35:46 dcerouter kernel: [351746.642541] EXT3 FS on hdb1, internal journal
Dec  3 19:35:59 dcerouter kernel: [351759.244301] EXT3 FS on hdb1, internal journal
Dec  3 19:36:12 dcerouter kernel: [351772.383059] EXT3 FS on hdb1, internal journal
Dec  3 19:36:25 dcerouter kernel: [351785.494768] EXT3 FS on hdb1, internal journal
Dec  3 19:36:26 dcerouter kernel: [351786.062511] EXT3 FS on hdb1, internal journal
Dec  3 19:36:38 dcerouter kernel: [351797.863389] EXT3 FS on hdb1, internal journal
Dec  3 19:36:51 dcerouter kernel: [351811.584782] EXT3 FS on hdb1, internal journal
Dec  3 19:36:56 dcerouter kernel: [351815.806408] EXT3 FS on hdb1, internal journal
Dec  3 19:37:09 dcerouter kernel: [351828.796895] EXT3 FS on hdb1, internal journal




tschak909

This is a side-effect of the nbd-based automounter which is used for each device in the system. It is normal.

-Thom

chrisbirkinshaw

Well I changed this bit of code:
## See if the drive is mountable
                        mountDirTemp=$(mktemp -d)                       
                        Log "mount ${IDrive_BlockDev} $mountDirTemp"
                        mount ${IDrive_BlockDev} $mountDirTemp #1>/dev/null 2>/dev/null
                        isDriveMountable=$?

                        if [[ "$isDriveMountable" != "0" ]] ;then
                                Log "Drive $IDrive_ID ($IDrive_BlockDev) cannot be mounted"
                                SetDeviceOnline "$IDrive_ID" "0"
                                rmdir $mountDirTemp
                                continue
                        else
                                umount -lf $mountDirTemp 1>/dev/null 2>/dev/null
                                Log "Drive $IDrive_ID ($IDrive_BlockDev) unmounted at stage 3"
                                rmdir $mountDirTemp
                        fi
               
                        SetDeviceOnline "$IDrive_ID" "1"



by adding "if [[ "$isDriveAvailable" != "0" ]] ;then" at the beginning and closing with "fi" at the end. i.e. now it does not try to mount and umount the drive unless it is not available.

Why is it normal to constantly test whether the drive is mountable when it is already mounted?

Cheers,

Chris