can I mount directory?
Hi,
I have 30gb ssd disk and 500gb hard disk. I want to use ssd disk as my system disk, and hard disk as all other. I want to keep ssd disk use as little as possible I want to mount: - swap partition to hard disk - /home directory to hard disk - /var directory to hard disk - /tmp directory to hard disk - /data directory to hard disk Do I really have to make partition for each mount to my hard disk eg: /dev/sdb1 - swap /dev/sdb2 - /home /dev/sdb3 - /var and so on... Or is there a way to mount those directories to matching directories on hd? So that I could make one partition and mount all those directories to corresponding directories on hd partition? This would be much better choice for disk space usage, as I should not need to define space for home directory, var directory and tmp directory separately. |
No, you cannot mount a directory.
But you can do the following: Imagine SSD disk is /dev/hda and hard disk is /dev/hdb You can mount SSD disk like this: /dev/hda - / And the 500gb hd like this: /dev/sdb1 - swap /dev/sdb2 - /home /dev/sdb3 - /var /dev/sdb4 (extended) /dev/sdb5 - /tmp /dev/sdb6 - /data About the hard drive space, you can use tools like Gparted to resize the partitions, so that's not really a problem. Hope it helped |
Yes, this is what I imagined.
Only problem is, that I must split hd to partitions, and i don't know how much space eg /var will take as time goes by.. If I could only make one partition, I could use all space as effective as possible, because all mounts would stay on same partition / space. Now I must decide (for example) that I assing 100gt to /home partition, and 50gt to /var partition, and changing that afterwards is difficult. |
You do not have to use separate partitions.
First install everything to the ssd disk. Also format the hdd as ext3 (or your preferred filesystem), but leave it empty for now. I think you will have to do this from a live distro to avoid moving files that are in use. Create a directory on the empty hdd called home. Now copy everything from the original home to the home directory on the new hard disk. Now delete your original home directory and then create a softlink to the new home directory (as root). Something like this if hdb1 is your hard disk: Code:
ln -s /media/hdb1/home /home That creates a pointer that will keep everything working the way it is supposed to because you didn't change any file paths, just moved things around on the disks. You should be able to repeat this procedure for other directories such as /var and /tmp etc. |
This sounds great, I will try it when my ssd arrives!
|
You also might want to look into lvm. This allows for quick resizing of partitions.
Brian |
Quote:
|
hi
yes u can for sure. but i don't know how
|
i dont know if you got the answer you needed, just stumbled across this post. i think the --bind, --rbind, or --move options will allow you to mount a directory, the problem is i dont know if it will pull the writes from one to the other. seperate partitions are the only way to keep your solid state drive with few writes. use the above commands with caution.
|
All times are GMT -5. The time now is 06:13 PM. |