LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 03-24-2008, 01:56 PM   #1
krymsunmortis
Member
 
Registered: Jan 2003
Location: Fort Worth Tx
Distribution: Slackware RedHat Mandrake BackTrack
Posts: 31

Rep: Reputation: 15
directories on different devices


Ok I want to appologize if this has been answered already but I cant seem to locate it in the forums so have decided to ask here in the newbie area. I have installed BT3 on to a 4g hdd as a full real install and have a 16g sdhc for more storage. now I know I could have did the live install and use the changes directory how ever this isnt the way I wanted to install this. now it works great from the HDD and here is what I am wanting to do. I am wanting to move my /home, /usr and maybe another directory to the SDHC. I have placed the modification in my fstab to mount the sdhc. the device is /dev/sdb1 and mounted as /mnt/sdb1. I am trying to decide should I add a line to my fstab showing /mnt/sdb1/home /home for example. Or should I copy the files to the /mnt/sdb1/home then remove the original /home and then use ln -s /mnt/sdb1/home /home to link to the directory ? would either conflict with any programs running such as compiz with KDE opening correctly, any of the other utilities ?

also besides /var /home /usr which other large root directory would any one advise to move to the sdhc?
 
Old 03-24-2008, 02:34 PM   #2
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
first off, you may want to proof-read your post before posting it, that was really hard to read - maybe add a paragraph or two. Just some constructive criticism.

if you're going to put /home on another drive, it should have its own partition. This means you would make a /dev/sdb1 and mount home there. That being the case, you fstab would look something like

/dev/sdb1 /home <options>

.. and then you would copy everything from old home to the new home, then reboot.

you could replace /home with a symbolic link to /mnt/sdb1/foo, leaving your fstab as it is now, which would [probably] work too, but that would certainly fall outside the standard & could be easily argued as being "wrong" even though it works. That said, some applications, settings, etc. don't like symbolic links, especially when they point outside the current tree.

as to your second question, to suggest moving folder to other drives requires a reason for moving them. Tell us why you want to move them & then (at least I) might offer a suggestion, otherwise I say, why move anything?

Last edited by BrianK; 03-24-2008 at 02:41 PM.
 
Old 03-24-2008, 07:15 PM   #3
krymsunmortis
Member
 
Registered: Jan 2003
Location: Fort Worth Tx
Distribution: Slackware RedHat Mandrake BackTrack
Posts: 31

Original Poster
Rep: Reputation: 15
well I have an EEE PC and have removed the Xandros OS and replaced it with Backtrack3. And since BT3 can be ran as a live install( live CD) or from real install (fully installed onto teh drive in non compressed format) It has a 4G HDD and once I installed BT3 onto it I only have .4G's left due to it using 3.6G's. I am wanting to make room for future upgrades and and installments and knowing that my /home and a couple other root directories will get larger as time goes on I am wanting to prevent running out of room. Since it recognizes the SDHC I am wanting to move these directories to this device. And am wanting to know the best way of doing this.

Since I do not know which directory will grow faster first I am wanting to place them onto the drive and was not sure if I was headed in the right direction.
 
Old 03-24-2008, 09:06 PM   #4
BrianK
Senior Member
 
Registered: Mar 2002
Location: Los Angeles, CA
Distribution: Debian, Ubuntu
Posts: 1,334

Rep: Reputation: 51
Quote:
Originally Posted by krymsunmortis View Post
well I have an EEE PC and have removed the Xandros OS and replaced it with Backtrack3. And since BT3 can be ran as a live install( live CD) or from real install (fully installed onto teh drive in non compressed format) It has a 4G HDD and once I installed BT3 onto it I only have .4G's left due to it using 3.6G's. I am wanting to make room for future upgrades and and installments and knowing that my /home and a couple other root directories will get larger as time goes on I am wanting to prevent running out of room. Since it recognizes the SDHC I am wanting to move these directories to this device. And am wanting to know the best way of doing this.

Since I do not know which directory will grow faster first I am wanting to place them onto the drive and was not sure if I was headed in the right direction.
ahh, well in that case, var & home are going to be the biggest issue being that var contains all the logs & home is where all user garbage goes. Some programs install in /opt, so if you plan on installing lots 3rd party apps, it might not be a bad idea to move that over to the new drive as well. Lots of apps use /tmp as temp space - it usually doesn't get *that* big unless you're dealing with really large or very many files, but if you want to be safe, that's another folder to consider for the move.

What about swap? Is that on your main drive? If so, you might want to move that over too being that it's unusable space. If you want to get fancy, you can half the size of swap & put it on both drives. IIRC, linux will swap in parallel, though I've not tested this, so use at your own risk.

fyi: if you break something in fstab & can't reboot, you can always boot off a live CD distro (Knoppix, Ubuntu, etc), mount your main drive, edit the fstab, then reboot without the live CD to go back to origianl settings.

Last edited by BrianK; 03-24-2008 at 09:08 PM.
 
Old 03-24-2008, 10:11 PM   #5
krymsunmortis
Member
 
Registered: Jan 2003
Location: Fort Worth Tx
Distribution: Slackware RedHat Mandrake BackTrack
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks
the setup doesnt use swap oddly enough. Not sure how but it doesnt lol.
Now to decide how to put it into fstab or to use sysmlinks. you stated sysmlinks could break some programs since that would be out side the normal tree path.

is there a way to say mount the drive move 2 or 3 directories to the drive then unmount and then mount them back to the correct location?

sorta like this

mount /dev/sda1 /mnt/sda1
cp -pR /home /mnt/sda1/home
cp -pR /var /mnt/sda1/var

then

umount /dev/sda1

rmdir -R /home
rmdir -R /var

mkdir /home
mkdir /var

mount /dev/sda1/home /home
mount /dev/sda1/var /var

in theory this woudl then have anything I do in /home or /var actually on the /dev/sda1/home or/dev/sda1/var

but would this work or would this crap out the system ?
 
  


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
rc.M reports failed devices are not directories: uevent: Not a directory mokele Slackware 5 02-20-2007 04:36 PM
system calls to devices?Talking to devices. kiruxa Linux - Hardware 6 12-09-2006 06:46 PM
what is the different btw raw devices and block devices yenonn Linux - General 2 02-10-2006 10:34 PM
Searching multiple directories and sub directories for a file jeep99899 Linux - Newbie 2 10-13-2005 01:23 PM
links (directories and devices) PJota Linux - Newbie 1 07-29-2003 11:45 AM


All times are GMT -5. The time now is 10:51 PM.

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