I have CentOS 6.8 installed on a flash drive and due to its limited life-cycle (100,000 writes (mean time before failure for each sector)), I want to mount it as read-only.
The kernel is supposedly launching as ro. At least, the result of cat /proc/cmdline
starts with "ro ...".
I have set up /etc/fstab
to mount read-only:
UUID=4addd4a7-97f6-4399-89e4-6d3728bd2979 / ext4 defaults,noatime,ro 1 1
UUID=21a81149-6534-4313-8696-e203896d5881 /boot ext4 defaults,noatime,ro 1 2
UUID=D64B-DD9C /boot/efi vfat noatime,ro,umask=0077,shortname=winnt 0 0
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
tmpfs /var/log tmpfs defaults 0 0
When I run mount
, I see that the specifications in /etc/fstab
were followed. In spite of this, I still can modify files and write new files. Further evidence of the mount being writable is running lsof
(according to this post). The results shows a few files open for writing, mostly on /home. (In order to arrive at this, I had to mount /var/log
as tmpfs
.)
Is this a bug in CentOS 6.8? Is there a workaround?