Bash: Cannot Create Temp File for Here-document: Read-only File System
Dear All,
I accept a seperate SATA drive on a CentOS 7 arrangement that I utilise to go on backups.
Recently, when I try to create or re-create files to the mounted bulldoze, I become and error saying
the file system is read only.
For example, if I attempt to create a new folder, I get " mkdir: cannot create directory test': Read-just file arrangement"
Whatever idea how I tin troubleshoot and fix this? Thanks
one.) backup contents of this bulldoze to a removable deejay
2.) bank check /etc/fstab to make certain mountain options and fs type are correct (is it set for rw admission)
3.) unmount the drive and run Fsck on it with Fsck -y /dev/device. (pay attention to results here to see any bug)
4.) after filesystem is fsck-ed mount it once again and meet if you lot can write to it now
Also, it may be the underlying disk going bad, check this link for instructions on how SMART disk monitoring works in Linux:
https:/
Hope this helps you lot notice the trouble.
-Moeen
7 Replies
You could endeavour remounting the mounted drive (substitute correct mount directory)
mountain -o remount,rw /mountdir
In addition to Eric's comment, you could run the mountain command to meet the what mount options are currently in place. If you lot run across "ro", that is the problem.
$ mount devtmpfs on /dev type devtmpfs (rw,relatime,size=3008544k,nr_inodes=752136,fashion=755) tmpfs on /dev/shm type tmpfs (rw,relatime) tmpfs on /run blazon tmpfs (rw,nosuid,nodev,relatime,mode=755) devpts on /dev/pts type devpts (rw,relatime,gid=5,mode=620,ptmxmode=000) /dev/sda2 on / type ext4 (rw,relatime,data=ordered)
1.) backup contents of this bulldoze to a removable disk
ii.) check /etc/fstab to brand sure mount options and fs type are correct (is information technology prepare for rw access)
3.) unmount the drive and run Fsck on it with Fsck -y /dev/device. (pay attending to results hither to see any problems)
4.) subsequently filesystem is fsck-ed mount it once again and see if you can write to it now
Also, it may be the underlying disk going bad, bank check this link for instructions on how SMART disk monitoring works in Linux:
https:/
Hope this helps you find the problem.
-Moeen
You could endeavour remounting the mounted drive (substitute correct mountain directory)
mountain -o remount,rw /mountdir
Huh, I always though y'all needed to specify the device prior to the directory when doing a remount. I didn't realize it was optional. You acquire something new every day.
Beginning by running the 'mount' command - It volition give you lot output like this
/dev/mapper/vg_floppyd-lv_root on / blazon ext4 (rw) proc on /proc blazon proc (rw) sysfs on /sys blazon sysfs (rw) devpts on /dev/pts type devpts (rw,gid=v,mode=620) tmpfs on /dev/shm blazon tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0") /dev/sdb1 on /kick type ext4 (rw) /dev/mapper/vg_floppyd-lv_home on /dwelling type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
The (rw) indicates they are currently mounted read-write.
If you accept a sectionalisation that is mounted read only when you think it should exist read-write, yous'll want to explore why. I'd start by looking at the log when that file system is mounted.
If information technology mounts on kick up, try something like 'dmesg | grep exam' or just run dmesg and peruse the whole affair.
If it mounts when you connect it, just sentry /var/log/messages as you connect it.
Often information technology means there is some sort of disk issue that's been detected, and information technology's mounted it read only to forbid you from making it worse. For instance, an NTFS partitioning that's marked as 'dirty' (needs a disk cheque on reboot) will mount read simply in Linux. The right solution here depends on the file system involved and the message you see when yous connect information technology.
Y'all could endeavour remounting the mounted drive (substitute correct mount directory)
mountain -o remount,rw /mountdirHuh, I always though y'all needed to specify the device prior to the directory when doing a remount. I didn't realize it was optional. You lot learn something new every day.
That's what I like about these forums--something new every day. :-)
From the "mount" man folio:
When mounting a filesystem mentioned in fstab or mtab, it suffices to requite only the device, or merely the mount point.
PC Pharm Limited is an IT service provider.
Update, the disk failed Smart tests. A restart of the server acquired the disk to be rw once again. Disk was replaced
Source: https://community.spiceworks.com/topic/2186377-read-only-file-system-linux
0 Response to "Bash: Cannot Create Temp File for Here-document: Read-only File System"
إرسال تعليق