1

I have 1 TB SSD and a 120 GB SSD. I'd like to use the 120 drive for

  • /
  • /var
  • /etc

and so on and make a very minimal home folder on that drive. I would then like to mount another drive (which I would name home) over my home folder.

Is this possible?

wittich
  • 1,174
  • 13
  • 26
RhythmInk
  • 113
  • See this. Skip the parts that don't apply to you. – Ashhar Hasan Mar 13 '16 at 03:58
  • I like to keep all system folders inside / (root) partition on SSD, so system is fast including hidden user settings in /home. But I have large data partition on HDD for all data which I mount at /mnt/data and link all folders like Documents, Music, etc back into /home. http://askubuntu.com/questions/524943/dual-boot-with-ssd-and-hdd-storage Why separate /var & /etc if all on SSD. Often better then as one partition as part of root. Server installs may want separate folder to isolate users & functions. – oldfred Mar 16 '16 at 13:29

2 Answers2

1

(!) Be careful while following these tips (!) because targeting the wrong device may destroy the data on your 120 GB disk (!)

Guessing your 1TB drive is /dev/sdb:

  1. Setup a new disk with the desired partition:

    $ sudo fdisk /dev/sdb
    create a new partition table - command: o
    create a new partition - command: n   (accept all proposed values)
    specify the type of the new partition - command: t / Type 83
    write the data to the disk and leave fdisk - command: w
    
  2. Format the new disk/partition:

    sudo mkfs.ext4 -L Home /dev/sdb1
    
  3. Mount the new partition temporarily, change owner, and copy your home-directory:

    mount /dev/sdb1 /mnt
    chown -R $USER.$USER /mnt
    cp -a $HOME/* /mnt/
    
  4. Unmount the partition:

    umount /mnt
    
  5. Look for the UUID assigned to your new partition:

    sudo tune2fs -l /dev/sdb1 | grep UUID
    
  6. Edit /etc/fstab and add a line:

    sudo vi /etc/fstab
    

    The new line (take the UUID from the tune2fs command) and replace USERNAME with your username i.e. the name of your home directory:

    UUID=15cc846c-36e4-42dd-8bfe-30acc8965d51 /home/USERNAME          ext4    defaults        0       2
    

After rebooting the system, you should see the 1TB partition mounted as your home directory. If the mount fails, you would see your old home directory as a kind of fallback.

cmks
  • 1,904
0

If I understand correctly a simple solution is just to use the mount command if the driver doesnt automatically mount and then using the ln command create a link of your driver to your home folder

basicly your systems should automatically detect the additional driver and you should be able to see it in your devices in your Files. You can then make a link using ln (kind of like a shortcut in windows) from the driver that would be in your /media/"username" to your home folder.

you can't however override your home folder with the new driver, but if thats what you want to do I recommend just create your home folder in your other driver.