2

I want advice on how to setup partitions on a new desktop system that I'll (initially) put Ubuntu 11.04 on. The system will have the following storage hardware:

  • 1 x 80 GB SSD (Intel 320 series)
  • 2 x 2 TB HDD (green, 64 MB cache, 5400 rpm, SATA-600)

I'm going to use the system to typeset with LaTeX, to watch movies, to listen to music, to edit images and graphics, to surf the web, as firewall for my LAN and as file and backup server for a laptop (it will sometimes need to be on for days). Some of the data I'm going to keep on it is really valuable so I'm not giving priority to speed over reliability or security. Also, I want to avoid unnecessary wear on the SSD.

The setup I'm considering is the following:

  • Have the SSD as boot partition, format it as ext4 (does ext4 work well with SSDs?) and mount it at /. Backup from the SSD will be handled by having sbackup scheduled to backup chosen files to the HDDs.
  • Put the HDDs in RAID-1, mostly for reliability, format them as ext4 (for reliability and ability to recover from corruption) and mount it somewhere, maybe /home/archive (what is the correct mount point according to convention?). Backup for these HDDs will simply be having them in RAID-1. Also, I'll keep the swap (how big?) on these HDDs.

I'm thinking that I should take measures to reduce wear on the SSD by mounting it with the flags noatime and discard and keep the swap on the HDDs (the system will have 4 GB RAM but I want to be able to hibernate). To further handle what goes on the SSD and what goes on the HDDs I'm thinking about using symlinks (e.g. symlink ~/Videos to the HDDs). I should say something about the needed storage capacity too. What I plan to initially put on the HDDs is ~400 GB.

My question: Is there anything in the setup that I'm considering that I should change given the mentioned hardware and the mentioned usage of the system? Or more generally: How should I setup my partitions given my hardware setup and how I want to use the system?

1
  • Before considering whether to ask this question I took some time to research it and had a hard time finding general advice (except for advice on SDDs). I guess it depends on it being hard to say general things about partition setup because it depends on individual user's needs and wishes. I'm aware of this question not being general but highly specific and that it in many parts depends on the subjective and that this goes against the form of questions on SX, so feel free to flag it if it does not belong here.
    – N.N.
    Jul 1, 2011 at 18:20

2 Answers 2

3

Raid is not backup. The purpose of raid1 is to keep the system up and running, instead of having to restore from backup when a drive fails. You still need to keep regular backups. Raid1 does not help if your filesystem becomes corrupted, or you just accidentally delete or overwrite a file.

Yes, ext4 works well on SSDs and the noatime and discard options are somewhat helpful.

You might want to use LVM

2
  • Good point. Maybe it's better to put /home on one HDD and reserve the other HDD for backups then. How would you suggest I use LVM?
    – N.N.
    Jul 2, 2011 at 10:10
  • @N.N. I'd suggest you use it to manage volumes instead of conventional partition tables, simply because of the increased flexibility it provides. Other than that, I agree with using one HDD for backup and the other for primary storage. You might want to keep the backup drive external and keep it in a fire proof safe when not using it as well.
    – psusi
    Jul 2, 2011 at 20:10
2

I think you sort of nailed it already.

  1. Test if trim is active with...
cd /tmp
sudo dd if=/dev/urandom of=tempfile count=100 bs=512k oflag=direct 
sudo hdparm --fibmap tempfile
sudo hdparm --read-sector 732160 /dev/sda
sudo rm tempfile
sync
sudo hdparm --read-sector 732160 /dev/sda
  

change the 732160 to a sector that --fibmap shows you.

  1. Use the 80 Gb for / only. Or set / to 25 Gb and leave the rest empty. Toss /home on your 2Tb too. I always put /home on 20 Gb and symlink the directories to another part with symlinks: I want to be able to format /home whenever I want w/o loosing any actual content.

  2. Add /tmp into ram with:

    tmpfs /tmp tmpfs nodev,nosuid,noexec,mode=1777 0 0

2
  • I thought adding discard to the boot flags was enough to enable trim. Could you please clarify point 1. starting with "Use the 80 Gb for..."? I'm having trouble following it.
    – N.N.
    Jul 2, 2011 at 10:14
  • - the command lines I added for trim test if trim is active. - regarding the 80 Gb ssd: use it for root only and not home/swap/any other partition. Home is written to often so best to not put it on the ssd
    – Rinzwind
    Jul 2, 2011 at 10:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .