Error: "Partition /dev/sda1 is mounted with write permissions, cannot check it" when running reiserfschk

  • 7005276
  • 03-Feb-2010
  • 27-Apr-2012

Environment


Novell Open Enterprise Server 1 (OES 1) Linux Support Pack 1 Linux
Novell Open Enterprise Server 1 (OES 1) Linux Support Pack 2 Linux
SUSE Linux Enterprise Server 11
SUSE Linux Enterprise Server 10
SUSE Linux Enterprise Server 9
SUSE Linux Enterprise Server 8

Situation

1. It is suspected that the storage device has some bad blocks
2. Application crashes the server without logging any information in any of the logs.
3. GroupWise POA running on Novel Cluster Services - Linux, will crash the SLES server intermittently
4. Bad blocks are suspected on the reiserfs partition and you would like to verify and fix the issue
5. You try to run "reiserfsck" on the device and it gives you write permissions error as given below:

Partition /dev/evms/container_1/rvol1 is mounted with write permissions, cannot check it

Resolution

1. Run "mount" command on the terminal
2.This will display the list of devices mounted on your server. Example given below:

SLESN2:~ # mount
/dev/sda2 on / type reiserfs (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
adminfs on /admin type adminfs (rw)
proc on /var/lib/ntp/proc type proc (rw)
admin on /_admin type nssadmin (rw)
/dev/hdc on /media/SU2SP1_001 type iso9660 (ro,nosuid,nodev,utf8,uid=0)
/dev/evms/container_1/rvol1 on /mnt/vol1 type reiserfs (rw)

3. Identify the device that is the problem. E.g: /dev/evms/container_1/rvol1 is suspected to have some bad blocks
4. You have to make the device read only in order to run "fsck" or "reiserfsck" on the device. Please find the command below to mount the device as read only. Example:

SLESN2:~ # mount -o remount,ro /dev/evms/container_1/rvol1

5. Verify if the device is now read only by running the "mount" command on the terminal console. You should see "ro" at the
end of the device. Example given below:

/dev/evms/container_1/rvol1 on /mnt/vol1 type reiserfs (ro)

6. Run the reiserfsck on the device now. Example:

 reiserfsck /dev/evms/container_1/rvol1

7. The above should prompt you for a confirmation, type "Yes" and press Enter.
8. The output on the screen should be like the one given below:


###########
reiserfsck --check started at Sun Feb  7 13:12:29 2010
###########
Filesystem seems mounted read-only. Skipping journal replay.
Checking internal tree.. finished
Comparing bitmaps..finished
Checking Semantic tree:
finished
No corruptions found
There are on the filesystem:
        Leaves 1
        Internal nodes 0
        Directories 3
        Other files 0
        Data block pointers 0 (0 of them are zero)
        Safe links 0
###########
reiserfsck finished at Sun Feb  7 13:12:29 2010
###########

9. If you get an error, go ahead and run the command to fix the errors. Example:

SLESN2:~ # reiserfsck --fix-fixable -l /var/log/fsck.log /dev/evms/container_1/rvol1

Out put will be something like below:

reiserfsck --fix-fixable started at Sun Feb  7 13:29:30 2010
###########
Filesystem seems mounted read-only. Skipping journal replay.
Checking internal tree.. finished
Comparing bitmaps..finished
Checking Semantic tree:
finished
No corruptions found
There are on the filesystem:
        Leaves 1
        Internal nodes 0
        Directories 3
        Other files 0
        Data block pointers 0 (0 of them are zero)
        Safe links 0

The partition is mounted ro. It is better to umount and mount it again.

###########
reiserfsck finished at Sun Feb  7 13:29:30 2010

10. After fixing the problem, remember to make the device Rw again. Example:

SLESN2:~ # mount -o remount,rw /dev/evms/container_1/rvol1

11. Verify the the device is seen as rw by running the mount command again.

Note: Please make sure that all you applications are shutdown during the above operation.