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 Answers
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?
- 110,243
I think one can spread several drives using a RAID 0. I use MDADM, although some motherboards allow to do it in EFI. I use MDADM to mirror 2 drivers (two HD sharing the same data), but RAID can also be used to create an array of drivers. Give it a try.
I have just confirmed what I said in my previous message.
I used 3 SDD's (a PNY 230GB, a WDC 250GB, and a ScanDisc 240GB) and created a virtual 730GB "drive" using mdadm with a raid level 0.
Here the steps I used:
- Install mdadm:
sudo apt-get install mdadm
(although I had it already installed)
- Identify the drives:
lsblk -o name,size,fstype,type,mountpoint
(Jot down the drives you want to join in an array). In my case they were sda, sdb, sdd
- Create the array (level 0)
sudo mdadm --create --verbose /dev/md0 --level=0 --raid-devices=3 /dev/sda /dev/sdb /dev/sdd
- Confirm the creation of the array:
cat /proc/mdstat
It should say that /dev/md0 was created
- Format the md0:
sudo mkfs.ext4 -F /dev/md0
You should be able to see a multi-disk somewhere in your desktop or launchbar.
You can create a mounting point and mount it. For example:
mkdir /home/"your-user-id"/MyArrayMnt
Then mount the array:
sudo mount /dev/md0 home/"your-user-id"/MyArrayMnt
Or you can add /dev/md0 to fstab. I use the later:
sudo CP /etc/fstab /etc/stab.bak
sudo "your-prefered-text-editor" /etc/fstab
Go to the end of the file and add the following line:
/dev/md0 /home/"your-user-id"/MyArrayMnt ext4 defaults, nofail, nodiscard 0 0
Or (all possible users)
/dev/md0 /home ext4 defaults, nofail, nodiscard 0 0
Save the file and reboot.
Note that in a raid level 0 if one drive fails everything is lost... Good luck!
Jorge
By the way,...
If you mount the array to home, in fstab, it will become your home folder: (In fstab)
/dev/ms0 /home/"your-user-id"/ ...
To use for all users, use in fstab
/dev/ms0 /home ...
This should answer the original question. Jorge – jorge sampaio
