3

When I first mount my external HDD, it claims to be mounted rw:

# mkdir /media/external-hdd
# mount /dev/sdb1 /media/external-hdd
# mount | grep sdb1
/dev/sdb1 on /media/external-hdd type ext3 (rw,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered)

However, if I attempt to write to it, I get an error, and it now shows up as read-only:

# touch /media/external-hdd/test
touch: cannot touch `/media/external-hdd/test': Read-only file system
# mount | grep sdb1
/dev/sdb1 on /media/external-hdd type ext3 (ro,relatime,errors=continue,user_xattr,acl,barrier=1,data=ordered)

EDIT: I think it has something to do with the ext3 journal, as I get the following when running dmesg:

[4964983.186798] EXT3-fs (sdb1): warning: mounting fs with errors, running e2fsck is recommended
[4964983.187960] EXT3-fs (sdb1): using internal journal
[4964983.187970] EXT3-fs (sdb1): recovery complete
[4964983.192469] EXT3-fs (sdb1): mounted filesystem with ordered data mode
[4964989.011023] end_request: I/O error, dev sdb, sector 976492584
[4964989.011040] Buffer I/O error on device sdb1, logical block 122061317
[4964989.011048] lost page write due to I/O error on sdb1
[4964989.011081] Aborting journal on device sdb1.
[4965081.221503] EXT3-fs (sdb1): error: ext3_journal_start_sb: Detected aborted journal
[4965081.221520] EXT3-fs (sdb1): error: remounting filesystem read-only
brjaga
  • 163
  • 3

1 Answers1

2

Try running fsck on the device before mounting it. It looks like there are errors that the OS wants you to correct before it will let you have full rw access.

you can do this by ensuring that you unmount the drive

umount /dev/xxxx

then type

fsck /dev/xxxx

Where 'xxxx' is the device identifier of the drive in question.

This happens because when you mount a drive, a very quick sanity check is performed in the background. If that check reports problems that don't stop you from accessing the drive, but may cause problems in the future the mount command won't allow you to write to the disk until it's fixed.

It will however allow you to read, in case you would like to try and move the files to a safe place before you try to fix it.

shawty
  • 362
  • 1
  • 7
  • 1
    When I do fsck, it says that it's fixing errors, but then when I try to write to the volume afterwards, it still switches back to read-only. And fsck says there are errors again – brjaga Sep 16 '15 at 23:51
  • 1
    In that case you might want to read all your files off the drive and replace it, sounds like the drive is on it's way to hard drive heaven. If fsck says it's fixing stuff, and quite clearly is unable to fix things, then it's time to replace the drive. – shawty Sep 17 '15 at 15:02
  • I was afraid that might be the case. Do you think reformatting the drive and starting over from scratch might help, or is it not worth the effort at this point? – brjaga Sep 17 '15 at 15:05
  • 1
    Reformat is always worth a try, but your most important task while you can still read it should be to ensure you have a good backup of your files first. – shawty Sep 17 '15 at 18:02