[clug] Suggestions on Partitions and Mounts for Solid State Disk Drive

Bob Edwards bob at cs.anu.edu.au
Sun Mar 26 22:57:59 UTC 2017

On 26/03/17 20:52, Andrew Janke via linux wrote:
> On 26 March 2017 at 18:35, Andrew Steele via linux
> <linux at lists.samba.org> wrote:
>> I'll bite. :-)
> metoo.

metoo as well...

Generally I don't think you need to think of SSDs as being all that
different to HDDs.

However, if you have one of each, you can mirror your important stuff
using RAID 1. You can even set up the RAID so that it "writes-mostly"
to the HDD, meaning almost all of the read activity will prefer the
SSD - FTW (actually, my measurements have only seen a marginal
improvement in overall R/W performance using "write-mostly", vs. just
letting the RAID system decide for itself how to schedule reads).

As per Andrew Steele, I use LVM, mainly because I use a lot of LXC
containers, and LVM is great at keeping their stuff separate (mainly,
in this case, a form of enforced quota per container).

However, I also use NFS to mount home dirs (as per Andrew Janke) - the
file server serving the home dirs also mirror's between SSD and HDD
and uses drdb to keep another copy on a different box (in real time).

As for swap, I still use a (smaller) swap partition, then augment it,
if/when required with a swap file.

Hope this helps,

Bob Edwards.

>> As there a reason you're wanting to use plain partitions rather than using
>> LVM?
>> Generally, I'd have a smallish /boot partition on sda1, then sda2 would be
>> the rest of the disk as a PV. Then all the various mounts would be LVs
>> which can be easily resized as the need arises.
> In a similar fashion to the advice of LVM have you considered running
> file based swap in order to reduce the number of partitions?
> I changed to this many years ago due to needs of {in,de}creasing swap
> on the fly. At the time it was on 500+ core linux clusters that were
> running variable size jobs. Since then I've also started doing this on
> laptops/desktops, the installer will gripe about no swap partition but
> just ignore that. There is no noticeable speed penalty in all the
> testing we've done, recipe for doing this is below:
> # 4GB file based swap
> dd if=/dev/zero of=/4GB-swap-00 bs=1M count=4096
> mkswap /4GB-swap-00
> swapon /4GB-swap-00
> echo >> /etc/fstab
> echo "# Swap file" >> /etc/fstab
> echo "/4GB-swap-00  none  swap  sw  0 0" >> /etc/fstab
> Note that when doing this you can have multiple swap files and just
> add/remove them as you choose, you can even mix/match swap
> partitions and files. If you are cautious you can flush the
> file cache before adding/removing:
> # to clear file cache (if you want)
> sync
> echo 3 > /proc/sys/vm/drop_caches
> echo 0 > /proc/sys/vm/drop_caches
> I myself typically don't run LVM and only run with two partitions on both
> clusters and desktops/laptops, / and /tmp with TMPDIR set to /tmp.
> Makes for simple management, home dirs and data are all via NFS
> or on a separate disk. The only time I run a separate /boot partition is
> to get around storage driver issues.
> I'm surprised that the major distros don't use swap files over
> partitions, it makes the install simpler.
> a

More information about the linux mailing list