Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save ewaldj/ad3035d87b97bb05cb3b65276d7f839f to your computer and use it in GitHub Desktop.

Select an option

Save ewaldj/ad3035d87b97bb05cb3b65276d7f839f to your computer and use it in GitHub Desktop.
DIY install debian on Oracle Cloud Infrastructure ( Free Tier ) - ARM64
# start from a ubuntu minimal install
# we need to shrink down the used space to move it in a tmpfs of 700MB
apt install lsof partprobe
snap remove oracle-cloud-agent
snap remove core18
snap remove snapd
apt purge snapd
rm -rf ~/snap
rm -rf /snap
rm -rf /var/cache/snapd
## check what other package takes lot of space
dpkg-query -Wf '${Installed-Size}\t${Package}\n' | sort -n
# remove big un
apt remove linux-modules-extra-5.4.0-1037-oracle
apt remove linux-oracle-headers-5.4.0-1037 linux-headers-5.4.0-1037-oracle
apt autoremove
apt autoclean
apt clean
# ok, the disk usage of / should be less than 600MB now
cd /
mount -t tmpfs -o size=700m tmpfs mnt
tar --one-file-system -c . | tar -C /mnt -x
mount --make-private -o remount,rw /
mount --move dev mnt/dev
mount --move proc mnt/proc
mount --move run mnt/run
mount --move sys mnt/sys
sed -i '/^[^#]/d;' mnt/etc/fstab
echo 'tmpfs / tmpfs defaults 0 0' >> mnt/etc/fstab
cd mnt
mkdir old_root
pivot_root . old_root
# now the root storage is the RAM
# lets restart all runnig process
service sshd restart
# now switch to a new ssh connexion to let the old sshd terminate
service systemd-udevd restart
service systemd-journald restart
service systemd-networkd restart
service systemd-timesyncd restart
service systemd-resolved restart
service systemd-logind restart
service networkd-dispatcher restart
pkill agetty
pkill dbus-daemon
pkill atd
pkill iscsid
pkill rpcbind
pkill unattended-upgrades
kill 1
umount -l /dev/sda1
curl https://cdimage.debian.org/cdimage/openstack/current/debian-10-openstack-amd64.raw | dd of=/dev/sda bs=1M
sync
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment