5

I have two 160GB drives on my laptop - sda and sdb. Is there any way to create a /home partition with more than 160GB? I tried to create a /home partition on both drives, but then it told me that I couldn't install Ubuntu with multiple /home partitions.

4
  • 3
    I don't know, but you can create a normal ext4 data partition on the second drive and mount it into a new directory of your /home folder. So all files in /home would be on disk one, except those in that specific folder (e.g. call it Data2). You could also mount it and bind it over an existing directory like ~/Videos and store all your Videos on the second disk. To better manage the space, you would have to create more than one partition and assign an equivalent number of directories.
    – Byte Commander
    Feb 10, 2015 at 23:24
  • 3
    This is what Logical Volume Management was designed for. However, @ByteCommander's method is far easier.
    – Jos
    Feb 10, 2015 at 23:29
  • @ByteCommander Would I be able to do the reverse? As in install swap, root, boot, and the normal ext4 on sda, and then mount that onto the home partition on sdb? Forgive my ignorance, but what should the mount point be for the normal ext4? Thanks!
    – RootFAIL
    Feb 10, 2015 at 23:33
  • Similar as config when SSD & hard drive. askubuntu.com/questions/524943/… AND: askubuntu.com/questions/223655/… and: askubuntu.com/questions/516353/…
    – oldfred
    Feb 10, 2015 at 23:54

1 Answer 1

7

It seems like you need a bit more information on the Linux directory system: You have one root directory / on your system. And this is where you have a number of folders like /home, /dev, /usr, /etc and so on. Some of the folders really exist on the disk, like home, usr and etc, but some are only virtual like proc or dev and contain temporary system/process/device info/represent them.

Now you have to understand that EVERY machine has this equal basic structure, independent of the underlying partitions. Every partition you mount gets placed into this one file system tree and bind to one specific directory. So e.g. your /home directory points to the partition sdb1 (which is represented by /dev/sdb1 by the way) while your /boot folder is located at sda1 and the rest of / is in sda2.
You can also just create a new folder like ~/data and bind the partition to this new folder.

So for your system you can say the following:

The only two partitions you need are / (the tree root) and swap (which does not get included into the tree). Then all data in any real directory under / would be stored in the root partition.
What you can do now is to take specific directories out of the root partition / and assign their own partition to them. Commonly you do this for /home and sometimes for /boot.

It is easy to do this at install time (select "do something else" when it ask whether it should install instead/alongside other OS and do the partitioning manually), but a bit more difficult to change it later, as you have to manually move the contents from the old directory to the new partition before you bind it. But it is of course possible and - this is the big advantage of this directory system - applications will not see any changes, as they still can access their files as before, because the path (e.g. /home/myusername/.mygame/hiscore) to all files stayed the same.

So what do you exactly want to do now and on which topic do you need further help?

file system/mounting visualization
image source:
http://h0lug.sourceforge.net/ForrestHo00/samples/ooo11/openOfficeEmbeddedImage/zip-Sernet-LATM-LPI-101-v-0.2-20050712-1243-noXSO.sxw/file-Pictures/10000000000002D00000021CF2F25855.png

5
  • I am doing a fresh install of Ubuntu using the "do something else" option. If I understand correctly, you're saying that making a partition for home just sets aside space for that directory? I am still not clear on how I should partition it to allocate more space for files and programs (eg. armory and the massive blockchain). Is there a mount point called /data? Should it be logical or primary? Thanks again!
    – RootFAIL
    Feb 11, 2015 at 0:22
  • 1
    I will look for a graphical explanation on the mount/bind thing. Programs would usually get installed somewhere inside /usr/ or /bin/ or /opt/ or /lib/ or get split over many of them. So I personally would just create a root "/" on sda1 for system and programs and everything else, a swap (about 1-2x your RAM size) on sda2 (if primary) or sda5 (automatically set if you chose logical), and allocate the whole second disk on sdb1 as /home/ to store your personal files and data. You can use primary partitions, as you only need logical ones to go around the limit of 5 partitions per disk.
    – Byte Commander
    Feb 11, 2015 at 0:40
  • Is this what you are talking about? askubuntu.com/questions/138547/…
    – RootFAIL
    Feb 11, 2015 at 0:48
  • 1
    If it helps you it is good. I thought more about visualizing how all partitions are mounted into that one directory tree.
    – Byte Commander
    Feb 11, 2015 at 0:51
  • This answer isn't clear enough for the question to be used as a duplicate target. I would prefer something like: You could create a filesystem on the 2nd partition and persistent mount that directory to a mount point in your home directory through fstab. link
    – karel
    Oct 4, 2020 at 10:10

You must log in to answer this question.

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