24

I have the following free spaces on 2 disks:

  1. SSD - 240G (sda)
  2. non-SSD - 240G (sdb)

I understand that I should use SSD to install packages and non-SSD just for storing data. What's the best partitioning schema (including swap) in my case?

When I tried automatic partitioning it installs only on 1 disk and dedicating 8G for swap.

PS. I'm going to install Linux Mint as a dual-boot alongside with Windows 7, which is already installed.

UPDATE: I have 8GB of RAM Windows has been installed on non-SSD drive.

Askar
  • 1,098

3 Answers3

27

On a hybrid solid-state and spinning disk system (like the one I'm typing this), you have two to three aims:

  • Speed up your system: as much commonly used data as possible stays on the SSD.
  • Keep volatile data off the SSD to reduce wear.
  • Optional: have some level of redundancy by using an md(4) (‘software RAID’) setup across the SSD and HDD(s).

If you're just meeting the first two goals, it's a simple task of coming up with a scheme somewhat like this (depending on which of these filesystems you use):

  • Solid state: / (root filesystem), /usr, /usr/local, /opt
  • Spinning disk: /var, /home, /tmp, swap

Since you have two disks, though, you can read the Multi HDD/SSD article on the Debian wiki. It'll walk you through setting up md(4) devices with your SSD as a ‘mostly-read’ device (fast reads, fewer writes), your HDD as a ‘mostly-write’ device (no-wear writes, fewer reads). The filesystems that would normally go on the SSD alone can now go on this md device. The kernel will read mostly from the SSD (with occasional, brief forays into the HDD to increase read throughput even more). It'll write to the HDD, but handle SSD writes with care to avoid wearing out the device. You get the best of both worlds (almost), and you don't have to worry about SSD wear rendering your data useless.

My laptop is running on a similar layout where /, /usr and /usr/local are on a RAID-1 device across a 64 GB SSD and a 64 GB partition on the 1TB HDD, and the rest of the filesystems are on the rest of the HDD. The rest of the HDD is one of two members of a RAID-1 setup, with one disk usually missing. When I'm at home, I plug in the second disk and let the md device synchronise. It's an added level of redundancy and an extra 1–7 day backup¹).

You should also have a look at the basic SSD optimisation guide for Debian (and friends).

Oh, and it's not guaranteed you'll be able to do this all via the installer. You may have to boot a rescue disk prior to installation, prepare (at least) the md(4) devices (I do the LVM PVs, VGs and LVs too because it's easier on the CLI), then boot the installer and just point out the volumes to it.

¹ RAID ≠ backup policy. I also have proper backups.

Alexios
  • 19,157
  • Dropping by in 2015, finding the Q&A useful, I'd add /srv to the list of directories for the spinning disk. – Run CMD Nov 06 '15 at 11:26
  • 1
    What I like in this scheme is it is possible to mount / and /usr in read-only mode. Adds an extra layer of security against root-mode blunders. – spectras Jan 25 '16 at 13:27
  • 2
    Why /usr and /usr/local are treated separately? Mounting /usr on the SSD isn't enough? – a06e Mar 30 '16 at 15:35
  • 1
    More than that, just mounting / on the SSD isn't enough? And then specify that that /var, /tmp and /home go on the HDD. – a06e Mar 30 '16 at 20:28
  • 1
    @alexios i don't understand how your proposed setup of mostly reads from SDD and mostly write from HDD works. You say you use RAID1, but RAID1 is just mirroring of the data, so any write you do in the HDD will be mirrored in the SDD. what am i missing?? – Hilikus May 21 '17 at 03:43
1

I came up with the following solution:

/dev/sda2 /boot ext2 300MB

/dev/sda3 root ext4 - the rest space of the sda

/dev/sdb2 swap 8G (it seems it's recommended to allocate swap partition on the non-SSD drive)

/dev/sdb3 /tmp 10G

/dev/sdb4 /home - the rest space of the sdb

Askar
  • 1,098
  • 5
    You forgot to mention what /dev/sda and /dev/sdb are. I know that sda is SSD, while sdb is HDD, but people who are new to these things might get it wrong – Salaros Feb 05 '15 at 16:34
  • @Salaros actually it depends on your system configuration, for example sda might correspond to HDD and sdb might correspond to SSD. "I know that sda is SSD, while sdb is HDD..." holds truth only for this answer. Other than that you are right, the answer should've been made which one is which obvious. – ozanmuyes May 13 '19 at 09:50
  • @ozanmuyes I know it depends on your system configuration. I meant in his/her example – Salaros May 14 '19 at 07:27
0

According to me it should be partitioned as follow.

Linuxmint /   Remaining GB in SSD
Linuxmint swap  8 GB 
Linuxmint /home  <non-ssd HDD> 
KK Patel
  • 1,855
  • I have updated my post. Windows has already been installed so no need to allocate space for it. Also, I don't need/want to create NTFS partition. – Askar Sep 03 '13 at 06:45