So, there are plenty of guides out there for people wanting to optimise their Raspbian setup; most of the procedures in such guides (thankfully!) seems to be already taken care of/unnecessary/not-applicable to Diet-Pi. However, there are some optimisations in some guides that seem like they might apply to Diet-Pi too. My questions are as follows:
- Of the following optimisations, are any of them possible/beneficial in Diet-Pi?
- If so, are the steps/procedure to accomplish them the same as in Raspbian?
A couple of common guides that seem like they have parts that might apply to Diet-Pi are here:
https://www.raspberrypi.org/forums/viewtopic.php?f=9&t=850
…but for convenience I’ll reproduce the procedures I had in mind directly:
- Format partitions with journalling disabled (before OS installation)
This cannot be done on the system drive, so let’s do it while we’re booting off another drive, at the same time we’re formatting it:
sudo mkfs.ext4 -O ^has_journal -L PiBoot /dev/sdx1
sudo fsck.ext4 -f /dev/sdx1
>
2) Remove the extra ttys/gettys
> tty2-tty6 will be disabled, keeping tty1 for console
>
> ```text
sed -i '/[2-6]:23:respawn:\/sbin\/getty 38400 tty[2-6]/s%^%#%g' /etc/inittab
Disable getty on the Raspberry Pi serial line
sed -i ‘/T0:23:respawn:/sbin/getty -L ttyAMA0 115200 vt100/s%^%#%g’ /etc/inittab
>
3) Disable IPv6
> Add .conf file to sysctl.d
>
> ```text
echo "net.ipv6.conf.all.disable_ipv6=1" > /etc/sysctl.d/disableipv6.conf
Disable the kernel module
echo ‘blacklist ipv6’ >> /etc/modprobe.d/blacklist
>
> Remove IPv6 hosts
>
> ```text
sed -i '/::/s%^%#%g' /etc/hosts
- Replace Deadline Scheduler with NOOP Scheduler
NOOP scheduler is best used with solid state devices such as flash memory.
sed -i ‘s/deadline/noop/g’ /boot/cmdline.txt
>
5) Disable recording of file and directory access times and set data ordering to writeback
> Open the hard drive config file with
>
> ```text
sudo nano /etc/fstab
Add the noatime (no access time), no diratime (same for directories instead of files) and data=writeback options after the defaults parameters for each drive, except swap. Modified line should read something like:
/dev/sda2 / ext4 defaults,data=writeback,noatime,nodiratime 0 0
>
> Do that for each drive, save, and remount your drives with
>
> ```text
mount -o remount /
If it turns out that some of these optimisations are in fact beneficial in Diet-Pi and/or the steps are different from those in Raspbian, and if there are no real plans to include them in the Diet-Pi installation or in DietPi-config, perhaps we should have a dedicated optimisation guide for Diet-Pi? Just a thought!
(In case the particular optimisations that apply to me are dependent upon what I want from my Pi: I want to run my (B+) Pi as a headless, offline, lightweight audio platform (in fact as the ‘brains’ of a boom box, ghetto blaster, Frankenstein sorta thing), wherein boot time, codec latency/throughput, etc. are the most important performance factors.)