HD permission issue

I have an internal HD that I use to store data on, there is no OS installed on it. Recently the HD is read-only, i can at times write/delete content but a lot of the time it’s read only. Can someone fix it please?

On 2014-01-10 00:46, Speedy624 wrote:
>
> I have an internal HD that I use to store data on, there is no OS
> installed on it. Recently the HD is read-only, i can at times
> write/delete content but a lot of the time it’s read only. Can someone
> fix it please?

When it becomes read-only, have a good look at the output of the mount
command, the line for that device. And also at dmesg output.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

On 2014-01-09, Speedy624 <Speedy624@no-mx.forums.opensuse.org> wrote:
>
> I have an internal HD that I use to store data on, there is no OS
> installed on it. Recently the HD is read-only, i can at times
> write/delete content but a lot of the time it’s read only. Can someone
> fix it please?

With your hard drive in read-only mode, please output the result of the following …


sh-4.2$ su -c "fdisk -l"
sh-4.2$ cat /etc/fstab
sh-4.2$ id

… inserting the text inside code tags iconified by octothorpes in the forum webpage toolbar.

output of ‘fdisk -l’

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000ddd1e

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048   251660287   125829120    7  HPFS/NTFS/exFAT
/dev/sda2       251660288   976769023   362554368    7  HPFS/NTFS/exFAT

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000acaf2

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048     4208639     2103296   82  Linux swap / Solaris
/dev/sdb2         4208640    46153727    20972544   83  Linux
/dev/sdb3        46153728   976773119   465309696   83  Linux

Disk /dev/sdc: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xfc1c3c8e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63   976768064   488384001    7  HPFS/NTFS/exFAT

Disk /dev/sdd: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00070fd3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *        2048     2050047     1024000   83  Linux
/dev/sdd2         2050048   976773119   487361536   8e  Linux LVM

Disk /dev/mapper/fedora_speedy624--pc-home: 436.1 GB, 436140507136 bytes
255 heads, 63 sectors/track, 53024 cylinders, total 851836928 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/fedora_speedy624--pc-swap: 10.5 GB, 10485760000 bytes
255 heads, 63 sectors/track, 1274 cylinders, total 20480000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/fedora_speedy624--pc-root: 52.4 GB, 52428800000 bytes
255 heads, 63 sectors/track, 6374 cylinders, total 102400000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

output of ‘cat /etc/fstab’

/dev/disk/by-id/ata-ST3500320AS_9QM2B2JY-part1 swap                 swap       defaults              0 0
/dev/fedora_speedy624-pc/swap swap                 swap       defaults              0 0
/dev/disk/by-id/ata-ST3500320AS_9QM2B2JY-part2 /                    ext4       acl,user_xattr        1 1
/dev/disk/by-id/ata-ST3500320AS_9QM2B2JY-part3 /home                ext4       defaults              1 2
proc                 /proc                proc       defaults              0 0
sysfs                /sys                 sysfs      noauto                0 0
debugfs              /sys/kernel/debug    debugfs    noauto                0 0
usbfs                /proc/bus/usb        usbfs      noauto                0 0
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0

output of ‘id’

uid=1000(speedy) gid=100(users) groups=100(users),33(video)

The hd that is read only shows 436GB and the filesystem type is ext3/ext4. i’m pretty certain it is the sdd drive.

On 2014-01-11 21:56, Speedy624 wrote:
> The hd that is read only shows 436GB and the filesystem type is
> ext3/ext4. i’m pretty certain it is the sdd drive.

What about the out output of “mount” I asked about?


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

I’m sorry, here is the output for ‘mount’

devtmpfs on /dev type devtmpfs (rw,relatime,size=2495340k,nr_inodes=623835,mode=755)
tmpfs on /dev/shm type tmpfs (rw,relatime)
tmpfs on /run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000)
/dev/sdb2 on / type ext4 (rw,relatime,data=ordered)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime)
tmpfs on /sys/fs/cgroup type tmpfs (rw,nosuid,nodev,noexec,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,cpuset)
cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,cpuacct,cpu)
cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,memory)
cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,devices)
cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,freezer)
cgroup on /sys/fs/cgroup/net_cls type cgroup (rw,nosuid,nodev,noexec,relatime,net_cls)
cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,blkio)
cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,perf_event)
cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,hugetlb)
systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=25,pgrp=1,timeout=300,minproto=5,maxproto=5,direct)
hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime)
mqueue on /dev/mqueue type mqueue (rw,relatime)
tmpfs on /var/lock type tmpfs (rw,nosuid,nodev,relatime,mode=755)
debugfs on /sys/kernel/debug type debugfs (rw,relatime)
tmpfs on /var/run type tmpfs (rw,nosuid,nodev,relatime,mode=755)
/dev/sdb3 on /home type ext4 (rw,relatime,data=ordered)
gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
gvfsd-fuse on /var/run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=100)
fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime)
**/dev/mapper/fedora_speedy624--pc-home on /run/media/speedy/c1f07c2b-d185-4b35-8311-814de851124c type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)**
/dev/mapper/fedora_speedy624--pc-home on /var/run/media/speedy/c1f07c2b-d185-4b35-8311-814de851124c type ext4 (rw,nosuid,nodev,relatime,data=ordered)
/dev/sdc1 on /run/media/speedy/Samsung type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sdc1 on /var/run/media/speedy/Samsung type fuseblk (rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096)
/dev/sdd1 on /run/media/speedy/d2ae0fc6-f31a-40f0-9e0c-5d35e28c80f2 type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
/dev/sdd1 on /var/run/media/speedy/d2ae0fc6-f31a-40f0-9e0c-5d35e28c80f2 type ext4 (rw,nosuid,nodev,relatime,data=ordered)


The line for the device is in bold and the output for ‘dmesg’ is too, I don’t know how to copy it all.

On 2014-01-11 22:46, Speedy624 wrote:

>
> I’m sorry, here is the output for ‘mount’
>

Thanks. The single line would have been enough. But was that at the time
the partition was read only? It has to be that instant, not when things
are normal.

>
> Code:
> --------------------
> /dev/mapper/fedora_speedy624–pc-home on /run/media/speedy/c1f07c2b-d185-4b35-8311-814de851124c type ext4 (rw,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
>
> --------------------

My suspicion is that in case of some errors Linux automatically changes
mounts to read only. When this happens it can be seen (I think) on the
mount output, because the “rw” there becomes “ro”. And of course, the
event is logged.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

That is a Linux file system do you have permissions for the actual files?

If you do not have write permissions for your user it can look to be r/o

On 2014-01-12 04:26, gogalthorp wrote:
>
> That is a Linux file system do you have permissions for the actual
> files?
>
> If you do not have write permissions for your user it can look to be r/o

True. But he says some times it is ro, sometimes rw…


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

The HD seems to be working as normal but what do I do when it is not?

On 2014-01-12 22:36, Speedy624 wrote:
>
> The HD seems to be working as normal but what do I do when it is not?

Do then what I told you to do. Post here what you find out.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

My problems are back, here is the output for ‘mount’

/dev/mapper/fedora_speedy624--pc-home on /run/media/speedy/c1f07c2b-d185-4b35-8311-814de851124c type ext4 (ro,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)

On 2014-01-17 01:56, Speedy624 wrote:
>
> My problems are back, here is the output for ‘mount’
>
>
> Code:
> --------------------
> /dev/mapper/fedora_speedy624–pc-home on /run/media/speedy/c1f07c2b-d185-4b35-8311-814de851124c type ext4 (ro,nosuid,nodev,relatime,data=ordered,uhelper=udisks2)
> --------------------

AHA! There you see, the device is mounted “ro”. That’s what I feared.
Now you have to read carefully the system log backwards, there will
probably be some line where it says that the device was switched to
“ro”. And above that line there will probably be some with errors.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

How do i get to the system log? Can I read it through the temrinal? if so, how?

On 2014-01-17 23:16, Speedy624 wrote:
>
> How do i get to the system log? Can I read it through the temrinal? if
> so, how?

Of course you can.

You can run “dmesg” in a terminal, it dumps recent events. Or you can
look at “/var/log/messages”:


less /var/log/messages


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

I have had the problem again and ran ‘dmesg’ in the terminal but do not see anything with ‘ro’.

On 2014-01-28 01:16, Speedy624 wrote:
>
> I have had the problem again and ran ‘dmesg’ in the terminal but do not
> see anything with ‘ro’.

And it does not say anything at all about that disk?


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)

Not that I can see. I have tried looking again the 2nd time too.

I have the following which is being repeated.

  174.159095] Pid: 4094, comm: pool Tainted: P           O 3.7.10-1.16-desktop #1
  174.159097] Call Trace:
  174.159110]  <ffffffff81004818>] dump_trace+0x88/0x300
  174.159116]  <ffffffff8158af33>] dump_stack+0x69/0x6f
  174.159123]  <ffffffff81045249>] warn_slowpath_common+0x79/0xc0
  174.159127]  <ffffffff8119ed5c>] mark_buffer_dirty+0x7c/0x90
  174.159133]  <ffffffff8120b929>] ext4_commit_super+0x169/0x210
  174.159138]  <ffffffff8120cec3>] __ext4_abort+0x33/0x130
  174.159141]  <ffffffff8120d3c5>] ext4_journal_start_sb+0xe5/0x150
  174.159148]  <ffffffff811f172f>] ext4_dirty_inode+0x1f/0x70
  174.159153]  <ffffffff81197f4d>] __mark_inode_dirty+0x3d/0x270
  174.159157]  <ffffffff81187db9>] update_time+0x89/0xe0
  174.159161]  <ffffffff8118800b>] touch_atime+0xfb/0x150
  174.159166]  <ffffffff81180ee3>] vfs_readdir+0xd3/0xf0
  174.159172]  <ffffffff81181021>] sys_getdents+0x91/0x120
  174.159176]  <ffffffff8159eaad>] system_call_fastpath+0x1a/0x1f
  174.159184]  <00007ff3e1ac4645>] 0x7ff3e1ac4644
  174.159186] --- end trace af7e03d467acafbd ]---
  174.183179] ata4.00: exception Emask 0x50 SAct 0x1 SErr 0x400800 action 0x6 frozen
  174.183184] ata4.00: irq_stat 0x08000000, interface fatal error
  174.183187] ata4: SError: { HostInt Handshk }
  174.183191] ata4.00: failed command: WRITE FPDMA QUEUED
  174.183196] ata4.00: cmd 61/08:00:00:50:1f/00:00:00:00:00/40 tag 0 ncq 4096 out
  174.183196]          res 40/00:00:00:50:1f/00:00:00:00:00/40 Emask 0x50 (ATA bus error)
  174.183198] ata4.00: status: { DRDY }
  174.183203] ata4: hard resetting link
  174.641613] ata4: softreset failed (device not ready)
  174.641619] ata4: applying PMP SRST workaround and retrying
  174.796386] ata4: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
  174.831285] ata4.00: SB600 AHCI: limiting to 255 sectors per cmd
  174.889506] ata4.00: SB600 AHCI: limiting to 255 sectors per cmd
  174.889511] ata4.00: configured for UDMA/33
  174.889527] ata4: EH complete
  174.915083] EXT4-fs error (device dm-0): ext4_journal_start_sb:350: Detected aborted journal
  174.915090] EXT4-fs (dm-0): Remounting filesystem read-only
  174.915250] ata4.00: exception Emask 0x50 SAct 0x1 SErr 0x400800 action 0x6 frozen
  174.915255] ata4.00: irq_stat 0x08000000, interface fatal error
  174.915258] ata4: SError: { HostInt Handshk }
  174.915262] ata4.00: failed command: WRITE FPDMA QUEUED
  174.915267] ata4.00: cmd 61/08:00:00:50:1f/00:00:00:00:00/40 tag 0 ncq 4096 out


On 2014-02-02 23:16, Speedy624 wrote:
>
> I have the following which is being repeated.
>
>
> Code:
> --------------------

> 174.889527] ata4: EH complete
> 174.915083] EXT4-fs error (device dm-0): ext4_journal_start_sb:350: Detected aborted journal
> 174.915090] EXT4-fs (dm-0): Remounting filesystem read-only

> --------------------

That’s it. Exactly what I suspected.

One of the disk interfaces fails for some reason. As a consequence, the
media connected to it is forced to read only mode so that the system
doesn’t do more damage by writing to it.

The most possible causes are bad cable, plug, or socket.


Cheers / Saludos,

Carlos E. R.
(from 12.3 x86_64 “Dartmouth” at Telcontar)