• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: How I mount 2 USB Drives for /usr & /var in Gentoo  (Read 1273 times)
jlpoole
Principal Software Engineer
Global Moderator
Jr. Member
*****

Karma: 2
Posts: 87

Principal Software Engineer -- Oracle Corporation


View Profile
« on: October 30, 2009, 09:07:45 PM »

I have attached to my SheevaPlug 2 Seagate 1.5 TB drives and a 16GB memory stick.  I installed Gentoo and have been loading up the SheevaPlug with all kinds of software only to find my /usr and /var directories quickly consuming the 16GB. 

So I decided to move /var and /usr off of the memory stick onto one of the hard drives.  If you do the same, make certain you copy your files with their permission intact -- I neglected to do so and am paying the price to have to go back and chown/chgrp on several nodes.

What I first did after copying /var and /usr to the hard drive and removing /usr and /var was to create symbolic links named /var and /usr pointing to their respective directories on one of the Seagate drive, but I found certain software detected my ploy and wouldn't work, so I had to come up with something more solid.

Enter "mount --bind".  Read up on the man page on mount; and this web page offered some perspective: http://aplawrence.com/Linux/mount_bind.html

So, your /etc/fstab might have entries like this:

Code:
/dev/sdb              /mnt/seagateA     ext3       noatime         0 0
/dev/sdc              /mnt/seagateB     ext3       noatime         0 0
/mnt/seagateA/var     /var              none       bind
/mnt/seagateA/usr     /usr              none       bind

I'm just trying this and will update if I have problems, but I thought I'd post this while it's on my mind so others needing to conserve space on their thumb drive and mapping out the larger branch to a hard drive would have something to consider.


Logged

The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation.

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #1 on: November 01, 2009, 02:15:55 PM »

What do you have under /var and /usr that would fill up a 16GB memory stick?
Why not create your own mountpoint (say /local). mount the 1.5TB drive there and avoid all sorts of update issues in the future?
/var and /usr are system partitions - user files (including user-installed applications ) are best placed elsewhere.

Logged

DamonHD
Full Member
***

Karma: 4
Posts: 169


View Profile WWW
« Reply #2 on: November 02, 2009, 03:16:42 AM »

Indeed.  I usually symlink busy bits of /var(/spool) and big bits of /usr (eg multiple Java installs!) to areas under a big external /local to shift some strain from the system areas without changing anything around too much.

Rgds

Damon
Logged

jlpoole
Principal Software Engineer
Global Moderator
Jr. Member
*****

Karma: 2
Posts: 87

Principal Software Engineer -- Oracle Corporation


View Profile
« Reply #3 on: November 02, 2009, 10:14:33 AM »

The burden of Gentoo is that is will make certain assumptions about your system as to where things go when it performs its emerges (automatic installs).   It's not clear to me how you can change the configuration so that "/local" would seamlessly integrate as a replacement.

I realize /var and /usr are system partitions, but they hold the lion's share of data.

As for my large amount of data... well, that comes with the territory of testing various software.

What do you have under /var and /usr that would fill up a 16GB memory stick?
Why not create your own mountpoint (say /local). mount the 1.5TB drive there and avoid all sorts of update issues in the future?
/var and /usr are system partitions - user files (including user-installed applications ) are best placed elsewhere.


Logged

The statements and opinions expressed here are my own and do not necessarily represent those of Oracle Corporation.

birdman
Sr. Member
****

Karma: 4
Posts: 440


View Profile WWW
« Reply #4 on: November 02, 2009, 02:50:32 PM »

I realize /var and /usr are system partitions, but they hold the lion's share of data.
Depends on your definition of "data".  They hold executables - most "data" is best off elsewhere.
Quote
As for my large amount of data... well, that comes with the territory of testing various software.
Which you build yourself?  Having configured it yourself?
Logged

Pages: [1]
Print
Jump to: