How to find details like whether the mounted file-system is read only or read-write?
In addition to it how to find details of the hard disk or partition health status without affecting the data of that mounted disk or partition?
How to find details like whether the mounted file-system is read only or read-write?
In addition to it how to find details of the hard disk or partition health status without affecting the data of that mounted disk or partition?
Command
mount
will list all mounted partitions and will indicate whether they are mounted read only (ro) or read-write (rw).There is no way to tell whether a filesystem is "healty" while mounted in a normal read-write mode. To determine whether a filesystem is healthy you need to use
fsck
(or a similar tool) and these require either unmounted filesystems or filesystems mounter read-only.I guess you could look in the kernel log using command
dmesg
and look for messages like "journal replayed" - they will indicate that the filesystem has been mounted dirty.The file
/proc/mounts
contains the neccessary information.For instance, there I have an entry for my jump drive
Coma separated list of options and specifically
rw
indicates that this is read-write mounted filesystem. For read-only it would sayro
you'll need a combination of tools, which I believe are bundled in the package smartmontools. This links holds a fairly nice plan.
The ones I pay attention to on my laptop (with SSD drive, different disks have different S.M.A.R.T. tests)
Especially the first indicator is nice, as it tells you how many bad sectors/blocks have been remapped on the disk.