2016-05-29 18:57:08 +03:00
|
|
|
Xubuntu 16.04 with read only root filesystem for SSD disk
|
|
|
|
----------------------------------------------------------
|
2016-05-16 02:55:04 +03:00
|
|
|
|
2016-05-29 18:57:08 +03:00
|
|
|
* example:
|
2016-05-22 02:45:45 +03:00
|
|
|
/dev/sda: HDD disk (mechanical disk)
|
|
|
|
/dev/sdc: SSD disk (solid state disk)
|
2016-05-29 18:57:08 +03:00
|
|
|
|
2016-05-16 20:31:33 +03:00
|
|
|
/dev/sda2: /home /tmp /var/tmp
|
2016-05-16 02:55:04 +03:00
|
|
|
/dev/sda3: swap
|
2016-05-29 18:57:08 +03:00
|
|
|
/dev/sdc1: /
|
|
|
|
|
|
|
|
* install xubuntu 16.04 in /dev/sdc1.
|
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* boot with xubuntu 16.04 in /dev/sdc1.
|
|
|
|
|
2016-05-29 18:57:08 +03:00
|
|
|
* mount /dev/sda2 /mnt
|
|
|
|
|
|
|
|
* mkdir /mnt/tmp ; chmod 1777 /mnt/tmp
|
|
|
|
|
|
|
|
* mkdir /mnt/home ; chmod 0755 /mnt/home
|
|
|
|
|
2016-05-31 04:03:29 +03:00
|
|
|
* mkdir -p /var/mounts/sda2 ; chmod 0755 /var/mounts/sda2
|
|
|
|
|
|
|
|
* mkdir -p /var/mounts/mediarw ; chmod 0755 /var/mounts/mediarw
|
|
|
|
|
|
|
|
* mkdir -p /var/mounts/mediaro ; chmod 0755 /var/mounts/mediaro
|
|
|
|
|
|
|
|
* mkdir -p /var/mounts/mediaro/share1 ; chmod 0755 /var/mounts/mediaro/share1
|
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* mkdir -p /var/mounts/log ; chmod 0775 /var/mounts/log ; chown root.syslog /var/mounts/log
|
2016-05-16 02:55:04 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* mkdir -p /var/mounts/lightdm ; chmod 0755 /var/mounts/lightdm ; chown lightdm.lightdm /var/mounts/lightdm
|
2016-05-16 02:55:04 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* rsync -av /home/ /mnt/home/
|
2016-05-16 02:55:04 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* rm -fr /home/* ; rm -fr /home/.* <-- CAUTION!
|
2016-05-16 02:55:04 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* rm -fr /tmp/* ; rm -fr /tmp/.*
|
2016-05-16 02:55:04 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* rm -fr /var/tmp/* ; rm -fr /var/tmp/.*
|
2016-05-16 02:55:04 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* rm -fr /var/log/* ; rm -fr /var/log/.*
|
2016-05-16 02:55:04 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* rm -fr /var/spool/* ; rm -fr /var/spool/.*
|
2016-05-16 02:55:04 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* rm -fr /var/lib/blueman/* ; rm -fr /var/lib/blueman/.*
|
2016-05-29 18:57:08 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* rm -fr /var/lib/lightdm/* ; rm -fr /var/lib/lightdm/.*
|
2016-05-29 18:57:08 +03:00
|
|
|
|
2016-06-04 21:21:35 +03:00
|
|
|
* rm -fr /var/lib/lightdm-data/* ; rm -fr /var/lib/lightdm-data/.*
|
2016-05-16 02:55:04 +03:00
|
|
|
|
|
|
|
* /etc/fstab
|
2016-06-04 21:21:35 +03:00
|
|
|
#--- root & swap ---
|
|
|
|
UUID=[UUID-SDC1] / ext4 ro,noatime,errors=remount-ro 0 1
|
|
|
|
UUID=[UUID-SDA3] none swap sw 0 0
|
|
|
|
|
|
|
|
#--- home & tmp ---
|
|
|
|
UUID=[UUID-SDA2] /var/mounts/sda2 ext4 rw,noatime,errors=remount-ro,x-systemd.requires=/ 0 1
|
|
|
|
/var/mounts/sda2/home /home none bind,x-systemd.requires=/var/mounts/sda2 0 0
|
|
|
|
/var/mounts/sda2/tmp /tmp none bind,x-systemd.requires=/var/mounts/sda2 0 0
|
|
|
|
/var/mounts/sda2/tmp /var/tmp none bind,x-systemd.requires=/var/mounts/sda2 0 0
|
|
|
|
|
|
|
|
#--- logs ---
|
|
|
|
tmpfs /var/mounts/log tmpfs rw,nosuid,nodev,noatime,mode=0777,size=8M,uid=root,gid=syslog,x-systemd.requires=/ 0 0
|
|
|
|
/var/mounts/log /var/log none bind,x-systemd.requires=/var/mounts/log 0 0
|
|
|
|
/var/mounts/log /var/spool none bind,x-systemd.requires=/var/mounts/log 0 0
|
|
|
|
/var/mounts/log /var/lib/blueman none bind,x-systemd.requires=/var/mounts/log 0 0
|
|
|
|
|
|
|
|
#--- lightdm ---
|
|
|
|
tmpfs /var/mounts/lightdm tmpfs rw,nosuid,nodev,noatime,mode=0755,size=1M,uid=lightdm,gid=lightdm,x-systemd.requires=/ 0 0
|
|
|
|
/var/mounts/lightdm /var/lib/lightdm none bind,x-systemd.requires=/var/mounts/lightdm 0 0
|
|
|
|
/var/mounts/lightdm /var/lib/lightdm-data none bind,x-systemd.requires=/var/mounts/lightdm 0 0
|
|
|
|
|
|
|
|
#--- media ---
|
|
|
|
tmpfs /var/mounts/mediarw tmpfs rw,nosuid,nodev,noatime,mode=0755,size=1M,uid=root,gid=root,x-systemd.requires=/ 0 0
|
|
|
|
aufs /media aufs rw,noatime,br=/var/mounts/mediarw=rw:/var/mounts/mediaro=ro,udba=reval,x-systemd.requires=/var/mounts/mediarw 0 0
|
|
|
|
|
|
|
|
#--- shares ---
|
|
|
|
[NFSSERVER]:/path/to/nfs/share1 /media/share1 nfs _netdev,rw,noauto,user,users,noexec,nosuid,nolock,noatime,nfsvers=3,sec=sys,udp,rsize=32768,wsize=32768 0 0
|
2016-05-29 18:57:08 +03:00
|
|
|
|
|
|
|
* /etc/default/grub
|
|
|
|
GRUB_TIMEOUT=N
|
|
|
|
GRUB_RECORDFAIL_TIMEOUT=$GRUB_TIMEOUT
|
|
|
|
update-grub
|
|
|
|
|
|
|
|
* /usr/local/bin/remountrw + chmod 744
|
2016-05-16 02:55:04 +03:00
|
|
|
mount -o remount,rw /
|
|
|
|
|
2016-05-29 18:57:08 +03:00
|
|
|
* /usr/local/bin/remountro + chmod 744
|
2016-05-16 02:55:04 +03:00
|
|
|
sync
|
|
|
|
sleep 1
|
|
|
|
mount -o remount,ro /
|
2016-05-16 20:31:33 +03:00
|
|
|
|
2016-05-19 19:18:31 +03:00
|
|
|
* Network Manager: wired connection with fixed IP address:
|
2016-05-31 04:03:29 +03:00
|
|
|
"/etc/NetworkManager/system-connections/Wired Connection" + chmod 600
|
2016-05-19 19:18:31 +03:00
|
|
|
|
|
|
|
[ethernet]
|
|
|
|
duplex=full
|
|
|
|
mac-address=xx:xx:xx:xx:xx:xx
|
|
|
|
|
|
|
|
[connection]
|
|
|
|
id=Wired Connection
|
|
|
|
uuid=66b010e7-d2b0-4e5a-a2d8-f1d8191a241d
|
|
|
|
type=ethernet
|
|
|
|
timestamp=1440124541
|
|
|
|
|
|
|
|
[ipv6]
|
|
|
|
method=auto
|
|
|
|
ip6-privacy=0
|
|
|
|
|
|
|
|
[ipv4]
|
|
|
|
method=manual
|
|
|
|
dns=<IP_ADDRESS>;
|
|
|
|
address1=<IP_ADDRESS>/<MASK 0-30>,<DEFAULT_GATEWAY>
|
|
|
|
may-fail=false
|
2016-05-29 18:57:08 +03:00
|
|
|
|
|
|
|
* Issues:
|
|
|
|
* The guest session not work: /etc/password and /etc/shadow are read only.
|
|
|
|
* Lightdm can not remember the last user logged.
|