• Recent blogs

    block device is write-protected, mounting read-only

    Que: Not able to write data in the File system. This file system is in VCS and
    while mounting the FS manually giving following error. 

    block device /dev/mapper/XXXXXXXXXXX is write-protected, mounting read-only


    To rectify the issue we followed following steps.

    This FS is under LVM. As it is in VCS, Once you offline the VG/FS related resources, it'll export the related VG as-well.
    Hence Offline the Mount resource Only to minimize the activity. For our case we had only one FS, hence to play it safe 
    we offlined the VG resource as well. Hence we have followed below steps to rectify the issue.

    Import the VG:
    vgimport testvg
    Activate the VG:
    vgchange -ay testvg

    FSCK the File system and fix the inode related errors.
    fsck.ext3 /dev/testvg/testlv
    FSCK the File system again for couple of times.
    fsck.ext3 /dev/testvg/testlv
    fsck.ext3 /dev/testvg/testlv

    Mount the File system:
     mount -t ext3 /dev/mapper/testvg-testlv /mountpoint
     Create and delete the test files to check if the FS is RW or RO.
    touch test
    rm test

    Once test is completed , Unmount the FS and export the VG.

     umount /mountpoint
    vgexport testvg
     Start the resouce through VCS and all should be fine now.

    No comments