LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-07-2009, 01:13 PM   #1
m_kane
Member
 
Registered: Jan 2009
Posts: 30

Rep: Reputation: 2
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.
 
Old 02-07-2009, 01:25 PM   #2
tokico
Member
 
Registered: Jan 2009
Posts: 49

Rep: Reputation: 18
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
 
Old 02-07-2009, 01:40 PM   #3
m_kane
Member
 
Registered: Jan 2009
Posts: 30

Original Poster
Rep: Reputation: 2
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.
 
Old 02-07-2009, 01:47 PM   #4
digerati1338
Member
 
Registered: May 2007
Location: CO
Distribution: Ubuntu
Posts: 152
Blog Entries: 1

Rep: Reputation: 18
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
I'm not sure if you'll run into problems here because this is on a live distro, but I think that softlink should work on the actual installed linux. Somebody correct me if I'm wrong.

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.

Last edited by digerati1338; 02-07-2009 at 05:00 PM.
 
Old 02-07-2009, 02:21 PM   #5
m_kane
Member
 
Registered: Jan 2009
Posts: 30

Original Poster
Rep: Reputation: 2
This sounds great, I will try it when my ssd arrives!
 
Old 02-07-2009, 04:41 PM   #6
BCarey
Senior Member
 
Registered: Oct 2005
Location: New Mexico
Distribution: Slackware
Posts: 1,597

Rep: Reputation: Disabled
You also might want to look into lvm. This allows for quick resizing of partitions.

Brian
 
Old 02-07-2009, 04:44 PM   #7
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
Quote:
Originally Posted by digerati1338 View Post
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 [b]home[b]. 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
I'm not sure if you'll run into problems here because this is on a live distro, but I think that softlink should work on the actual installed linux. Somebody correct me if I'm wrong.

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.
You would probably want ext2 for a ssd
 
Old 03-08-2009, 10:53 PM   #8
palisetty_suman
Member
 
Registered: Feb 2007
Location: TX, USA
Distribution: fedora
Posts: 191

Rep: Reputation: 33
Thumbs up hi

yes u can for sure. but i don't know how
 
Old 09-27-2009, 10:20 PM   #9
edong23
Member
 
Registered: Apr 2005
Distribution: Slackware
Posts: 350

Rep: Reputation: 30
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
mount.cifs - mount error 20 = Not a directory da_kidd_er Linux - Networking 10 10-16-2008 01:55 PM
Mount directory sunhui Linux - Software 2 02-02-2006 09:03 AM
Apache Directory Listing Of NFS Mount, cannot view directory list via apache luqmana Linux - Networking 2 12-19-2005 07:03 AM
mount:not a directory. Suse dvd mount problem tzanis Linux - General 8 11-06-2005 12:30 PM
how to mount a directory Johng Linux - General 6 04-21-2005 07:41 AM


All times are GMT -5. The time now is 10:45 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration