Questions tagged [readonly]
257 questions
107
votes
3 answers
Why can rm remove read-only files?
If I create a file and then change its permissions to 444 (read-only), how come rm can remove it?
If I do this:
echo test > test.txt
chmod 444 test.txt
rm test.txt
...rm will ask if I want to remove the write-protected file test.txt. I would have…
Magnus
- 1,403
- 3
- 14
- 14
60
votes
7 answers
How can I exit from read-only mode in Vim?
I opened a file in readonly mode; is there a way to get out of readonly mode?
wrongusername
- 1,027
- 3
- 11
- 17
42
votes
3 answers
How do I make a file NOT modifiable?
While logged in, I can do the following:
mkdir foo
touch foo/bar
chmod 400 foo/bar
chmod 500 foo
Then I can open vim (not as root), edit bar, force a write with w!, and the file is modified.
How can I make the operating system disallow any file…
user2141130
- 535
- 1
- 4
- 7
42
votes
3 answers
Why doesn't mount respect the read only option for bind mounts?
On my Arch Linux system (Linux Kernel 3.14.2) bind mounts do not respect the read only option
# mkdir test
# mount --bind -o ro test/ /mnt
# touch /mnt/foo
creates the file /mnt/foo. The relevant entry in /proc/mounts is
/dev/sda2 /mnt ext4…
StrongBad
- 5,151
- 9
- 47
- 73
32
votes
1 answer
read only root filesystem
Somehow my Debian went to read only in root file system. I have no idea how this could have happened.
For example when I am in /root folder and type command nano and after that press Tab to list possible file in that folder I get the…
s1c
- 597
- 2
- 6
- 10
30
votes
2 answers
Remount a busy disk to read-only mode
I want to force a disk partition to read only mode and keep it read-only for more than 30 minutes.
What I have tried:
mount -o remount,ro (partition-identifier) (mount-point) -t (filesystem)
Issue: This gave device busy error as some processes…
AdithyaCS
- 401
- 1
- 4
- 4
28
votes
4 answers
Rm can't delete file
chmod 777 -R /mnt
rm -rf /mnt/*
rm: cannot remove 'omitted': Read-only file system
rm: cannot remove 'omitted': Read-only file system
Please show me how I can do this?
Fnzh Xx
- 485
- 1
- 4
- 5
24
votes
7 answers
Linux, how to change HDD state from ReadOnly after temporarly crash?
At this time no ansver for this problem.
Usually after some problems with readings or writings to block device, kernel decides to switch flag for WHOLE DEVICE as read-only. After this any writings to any partition / filesystem located on this device…
Znik
- 639
- 1
- 8
- 15
24
votes
4 answers
Mount a filesystem read-only, and redirect writes to RAM?
Is it possible to mount a loopback file as read-only, and redirect all writes to RAM?
user541686
- 3,033
- 5
- 28
- 43
23
votes
3 answers
Why is my file system mounted as read-only?
I've put together a small system with busybox, a Linux kernel, and a small file system, putting stuff in as it seemed necessary -- I don't know if I've been learning much from this, but I started out pretty clueless, so it sure hasn't been a smooth…
math4tots
- 2,665
- 8
- 32
- 42
22
votes
6 answers
read only TMOUT variable – workaround to disable automatically exit shell when there is no activity
We have here a read only Bash variable. I am not allowed to unset that variable.
$ echo $TMOUT
1800
As a workaround I wrote those lines (that my session don't exit)
#!/usr/bin/perl
$|++;
while (1) { print "\e[0n"; sleep 120; }
Is there an…
Sybil
- 1,653
- 5
- 19
- 37
19
votes
2 answers
Give read-only access to specific folders?
I would like to give read-only access to a user but I want him/her to see only the exact folders I give access. for example he/she shouldn't travel around all the server and browse to all users folders etc. even if he/she only goes up, up, up I want…
Anarkie
- 291
- 1
- 2
- 3
17
votes
2 answers
Is using a read only root file system a good idea for embedded setup?
I have been tasked with running Linux as an operating system on an embedded device.
The target has an x86 processor and has 8 GB CompactFlash device for storage.
I have managed to use buildroot to create the kernel image and cross compilation…
mathematician1975
- 1,453
- 2
- 24
- 43
13
votes
4 answers
Unable to remount / back to read-only after package upgrade
I am using Debian Stretch. My root partition is mounted read-only. Only when I install or upgrade packages, is / remounted to read-write (by using apt hook), and then remounted back to ro.
Sometimes after package upgrade I am unable to remount /…
Martin Vegter
- 69
- 66
- 195
- 326
12
votes
3 answers
bash: Some issue when using read <<<"$VARIABLE" on a read-only root partition. Any known workarounds?
Just by coincidence I had to use my ATA-ID-to-device-name script (found here: https://serverfault.com/questions/244944/linux-ata-errors-translating-to-a-device-name/426561#426561) on a read-only / partition. In case you're curious, it was an Ubuntu…
syntaxerror
- 2,236
- 2
- 27
- 49