I have received update from backend team. I have updated the
issue thread [1] with detailed information and posting the update here as well.
Issue:
Compute Engine VM instances running RHEL 7 or CentOS 7 public images published on GCP prior to rhel-7-v20170816 (centos-7-v20170816), on restart, start with the root filesystem mounted in read only mode after Red Hat released updated packages as part of the RHEL 7.4 release on July 31, 2017 and CentOS 7 release 1708 on Sept 14, 2017. The update included an updated kernel package (version 3.10.0-693) which affected an existing mount option used for XFS filesystems in RHEL 7 and CentOS 7 causing root filesystem to mount in the read-only mode.
------
Remediation Steps:
Google has released an updated gce-package update that fixes this automatically for VM instances running RHEL 7 or CentOS 7 images between rhel-7-v20160418 (centos-7-v20160418) and rhel-7-v20170719 (centos-7-v20170719) as a part of a gce-package update. Instances created using RHEL 7 or CentOS 7 images before rhel-7-v20160418 (centos-7-v20160418) require a manual fix.
Fix for instances using RHEL 7 or CentOS 7 images between rhel-7-v20160418 (centos-7-v20160418) and rhel-7-
v20170719 (centos-7-v20170719)
- Run `sudo yum -y update` to update all installed packages including the `gce-disk-expand` package which
contains the fix.
Fix for instances using using RHEL 7 or CentOS 7 images before rhel-7-v20160418 (centos-7-v20160418):
- Remove the “barrier” mount option in the `/etc/fstab` file by looking for `barrier=1` or ‘barrier=0’ and removing that option (the only mount option needs to be `default`). You can run following command to do this:
sudo sed -i 's/defaults,barrier[^ ,]*/defaults/' /etc/fstab
For example: In “/etc/fstab”
UUID=
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / xfs defaults,barrier=1 0 0
To manually fix the problem remove the `barrier=n` option to make this line look like the following (UUID will be different):
UUID=
xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx / xfs defaults 0 0
Note: “defaults 0 0” may vary depending upon the image in use and UUID will be different as well. *Only “barrier=n” option need to be removed.
Remediation steps for affected instances:
- If VM instance root filesystem is already started in read-only mode after Kernel update, you can perform following
options:
gcloud compute ssh YOUR_INSTANCE --command "sudo mount -o remount,rw /dev/sda1 /"
After the filesystem is mounted in read write mode again, follow the fix step to remove the 'barrier=n' option from the '/etc/fstab' file as mentioned above.
[1]
https://issuetracker.google.com/65658554