0

My PC has two SSDs (120GB and 465GB), the smaller SSD is mounted on / and currently the larger SSD is mounted on /tmp. Output of df -h:

    Filesystem      Size  Used Avail Use% Mounted on
udev             12G     0   12G   0% /dev
tmpfs           2.4G  114M  2.3G   5% /run
/dev/sda1       101G   88G  8.1G  92% /
tmpfs            12G  130M   12G   2% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs            12G     0   12G   0% /sys/fs/cgroup
/dev/sdb5       459G   73M  435G   1% /tmp
tmpfs           2.4G  112K  2.4G   1% /run/user/1001

I have quite limited experience in doing this so I'm just looking for the easiest way of re-allocating space from the larger SSD to / or to /home from /tmp.

(Note: I didn't create this set-up myself, there was a previous user who mounted the drives in this way.)

fdisk -l output:

Disk /dev/sda: 119.2 GiB, 128035676160 bytes, 250069680 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos

Device     Boot     Start       End   Sectors   Size Id Type
/dev/sda1  *         2048 214843391 214841344 102.5G 83 Linux
/dev/sda2       214845438 250068991  35223554  16.8G  5 Extended
/dev/sda5       214845440 250068991  35223552  16.8G 82 Linux swap / Solaris


Disk /dev/sdb: 465.8 GiB, 500107862016 bytes, 976773168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos

Device     Boot Start       End   Sectors   Size Id Type
/dev/sdb1        2046 976771071 976769026 465.8G  5 Extended
/dev/sdb5        2048 976771071 976769024 465.8G 83 Linux
  • this is easily done if your setup had used different format options (eg. lvm). in your case I'd just boot a live usb-thumb drive (eg. ubuntu install media) and copy directories such as /home to the second drive (after cp has completed; I'd diff to ensure they copied correctly; then rm only if you're happy; yes you could mv but the added diff compare step makes me happier). then modify your /etc/fstab to reflect your new chosen layout & reboot your normal ubuntu os. – guiverc Nov 16 '17 at 11:35
0

First unmount the sdb5

sudo umount /tmp

then mount it to your home directory using:

sudo mount /dev/sdb5 /home

refer to mapages of mount for more details.

  • before I did that; I'd copy the data you want from your existing home, to a directory on the larger SSD, and then mount that directory as your new $HOME. the reason for this is the newer mount will overshadow your existing $HOME & any files there will become hidden (ie. you can't access them when the larger SSD is mounted as $HOME). – guiverc Nov 16 '17 at 11:33
  • It doesn't allow me to umount /tmp as the device is busy. I tried killing the processes on /tmp as suggested here askubuntu.com/questions/199565/not-enough-space-on-tmp, but killing the processes logs me out. – Danny Friar Nov 16 '17 at 11:39

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.