How to Partition Ssd+Hdd in Ubuntu?
Tags: ubuntu
Published: 2021-12-14 05:05:09

---
title: How to Partition Ssd+Hdd in Ubuntu?
published: true
date: 2021-11-28 05:14:13 UTC
tags: Ubuntu
canonical_url: https://stackallflow.com/ubuntu/how-to-partition-ssdhdd-in-ubuntu/
---

<header>
<p><span style="font-size: 1.2em; color: initial;">partitioning</span><span style="font-size: 1.2em; color: initial;">system-installation</span></p>
</header>

I have installed Ubuntu 14.04 on **1TB HDD** and have installed lots of packages and softwares. Now i’ve bought an **128GB SSD** , I have few questions on how to partition `SSD` and `HDD` and how to move my current installation to `SSD`.

I’m thinking to have `/` and `/home` on **SSD** , and store other files on **HDD** , so how can i partition SSD+HDD to have:

- `/` and `/home` on **SSD**
- have `/home/music`, `/home/videos`, `/home/downloads`, `/home/pictures` on **HDD**
- I have no idea about `swap` partition (should it be on SSD or HDD, actually its empty most of the time now), my laptop has 16 GBs of RAM

I’m planning to have fresh install of `14.04` on **SSD** (and i think i have to), so what is the best way to move currently installed packages to new installation ? i’m planning to use `Aptik` for that, is there a better solution ?

Is `preload` any good and gives performance boost when using **SSD** (i have 16 GBs of RAM)

#### Accepted Answer

You have almost the same setup as me. 128 GB SSD 1.5 TB conventional.

Here is how I would do it:

- Leave everything on the conventional drive for the time being.
- Install and partition the ssd using a live distribution usb stick. I wouldn’t even touch your old drive here.
- See if everything boots to the new partition okay. You may need to adjust bios settings to make it boot to your new drive.
- set up the mountpoint

```
sudo -i
mkdir /media/hdd
blkid

```

You will get something like the following:

```
/dev/sda1: UUID="0f6e1051-cf9f-4299-b691-76d0d8c532d1" TYPE="ext4" 
/dev/sda5: UUID="058b6235-7e74-42ce-96c9-59f6cb0a44f3" TYPE="swap" 
/dev/sdb1: UUID="40a50699-a900-4bfe-a9e4-6587c1a83464" TYPE="ext4" 

```

copy the UUID of your secondary drive (mine is sdb1)

```
nano /etc/fstab
```

paste in uuid line without the quotes and add some fstab goodness:

```
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
#                
# / was on /dev/sda1 during installation
UUID=0f6e1051-cf9f-4299-b691-76d0d8c532d1 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=058b6235-7e74-42ce-96c9-59f6cb0a44f3 none swap sw 0 0
# /media/hdd on /dev/sdb1
UUID=40a50699-a900-4bfe-a9e4-6587c1a83464 /media/hdd ext4 defaults 0 2    

```

You may need to change the ext4 to something else if your other drive is formatted differently.

Check to make sure mounts properly

```
mount /media/hdd
```

and see if it works.

- make sure permissions are okay in /mnt/hdd/home/username
```
ls -l /mnt/hdd/home/username
```

where username is the name of your user.  
if the permissions look okay skip, if not (still with root)

```
chown username:username -R /media/home/username

```

- Link directories you want in home with those on the ssd

These can be done with user permissions, I would suggest you do this with empty directories: For example Pictures

```
cd ~
rm -rf Pictures
ln -sf /media/hdd/home/username/Pictures .

```

Do this for any directory you expect to take too much space, for me it’s Pictures, Music, Documents, Videos

- (optional) Carefully clean up the /media/hdd/ directory with root permissions. By carefully I mean do not delete /media/hdd/home !

The post [How to Partition Ssd+Hdd in Ubuntu?](https://stackallflow.com/ubuntu/how-to-partition-ssdhdd-in-ubuntu/) appeared first on [Stack All Flow](https://stackallflow.com).