Pi-Star How To: Make File System Read/Write (RW)

Good post on removing the read only normal mode of the file system in Pi-Star. Note, you may have to redo this on occasion as updates might put parts back. And he missed one (or it was added later) in /etc/rc.local you can change to rw from ro. I replace bash shell with fish shell, so I leave the bash indicator. If you get a drive write error later from an update, you can type bash <enter> to go into the bash shell and still see the ro or rw indicator to troubleshoot what might have been added back in.

https://vk3erw.com/pi-star/pi-star-how-to-make-file-system-read-write-rw


The concept of a read only file system may not suit all users so here are the instructions how to change the pi-star configuration so the file system is always in RW mode.

Note: Some of the files modified in this procedure may be overwritten during future Pi-Star upgradates.

Step 1 – mount file system as RW on boot:

File: /etc/fstab
change ro to rw in line 3 + 4

/dev/mmcblk0p1     /boot       vfat    defaults,rw         0   2
/dev/mmcblk0p2      /       ext4    defaults,noatime,rw     0   1

 Step 2 – prevent remount on logout:

File: /etc/bash.bash_logout
comment out line 9 + 10

#sudo mount -o remount,ro /
#sudo mount -o remount,ro /boot

Step 3 – To remove “(rw)” and “(ro)” from the command prompt. Note: this is only an indication, will not affect the file system

File: /etc/bash.bashrc
near the end of the file, modify both “PS1= …” lines by removing “${fs_mode:+($fs_mode)}

    if [ $(id -u) -eq 0 ];
      then
#        PS1='\[\033[01;31m\]\u@\h${fs_mode:+($fs_mode)}\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
        PS1='\[\033[01;31m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \$ '
      else
#        PS1='\[\033[01;32m\]\u@\h${fs_mode:+($fs_mode)}\[\033[00m\]:\[\033[01;34m\]\W\[\033[00m\]\$ '
        PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\] \$ '
    fi

Note: in this example the original lines are commented out to illustrate the changes. 

Step 4 – prevent hourly RO remount

File: /usr/local/sbin/pistar-hourly.cron
comment out the last line of the file

# Mount the disk RO
# mount -o remount,ro /