Author Topic: Disk is umounted and remounted a few times a minute  (Read 844 times)

chrisbirkinshaw

  • Guru
  • ****
  • Posts: 431
    • View Profile
Disk is umounted and remounted a few times a minute
« on: December 03, 2007, 09:00:49 pm »
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:

Code: [Select]
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


chrisbirkinshaw

  • Guru
  • ****
  • Posts: 431
    • View Profile
Re: Disk is umounted and remounted a few times a minute
« Reply #1 on: December 04, 2007, 07:51:26 pm »

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5476
  • DOES work for LinuxMCE.
    • View Profile
Re: Disk is umounted and remounted a few times a minute
« Reply #2 on: December 04, 2007, 08:25:08 pm »
This is a side-effect of the nbd-based automounter which is used for each device in the system. It is normal.

-Thom

chrisbirkinshaw

  • Guru
  • ****
  • Posts: 431
    • View Profile
Re: Disk is umounted and remounted a few times a minute
« Reply #3 on: December 14, 2007, 12:51:18 pm »
Well I changed this bit of code:
Code: [Select]
## 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