FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 03-13-2012, 04:39 AM
Pandu Poluan
 
Default bindmount or symlink?

On Tue, Mar 13, 2012 at 12:11, Canek Peláez Valdés <caneko@gmail.com> wrote:
> On Mon, Mar 12, 2012 at 11:04 PM, Pandu Poluan <pandu@poluan.info> wrote:
>> I am seriously thinking of splitting the storage of directories under /usr,
>> e.g., /usr/portage and /usr/source actually living somewhere else, on
>> different partition and different filesystem. Let's say something mounted on
>> /mnt/Persistent.
>>
>> My question: should I use bindmount or symlinks to do that? What's the
>> drawbacks/benefits for either?
>
> I'm sorry, I don't understand. What's the problem of having the
> following in /etc/fstab?
>
> LABEL=Portage * /usr/portage * * * * * *ext4 * * * * * *noatime,auto * * * * * * * * * *0 2
> LABEL=Source * * * * * */usr/source * * * * * * ext4 * * * * * *noatime,auto * * * * * * * * * *0 2
>
> (Replace LABEL=Portage with /dev/sda7, if you want to.)
>
> Why do you need to bindmount or link the directories when you can
> mount them wherever you want?
>

Because I am avoiding "single partition per directory". And a slight
mistake in my original email, it's not just /usr but also /var (and
other root-based directories that will not interfere with boot-up /
operations)

Let me give an example:

Let's say I have /dev/sdc and /dev/sdd, both having single partition
each (/dev/sdc1 and /dev/sdd1).

/dev/sdc1 will be formatted reiserfs mounted into /mnt/Persistent1

/dev/sdd1 will be formatted ext4 mounted into /mnt/Persistent2

Directories not really necessary for daily operations, such as
/usr/src, /usr/portage, /var/db/pkg, and so on and so forth, will each
be a subdir under either /mnt/Persistent1 or /mnt/Persistent2
according to each directory's nature.

Let's take the example of /usr/src ... I can either make /usr/src a
symlink to /mnt/Persistent1/src, or bindmount /mnt/Persistent1/src to
/usr/src

What will be the benefits/drawbacks for bindmount vs symlink?

Rgds,
--
FdS Pandu E Poluan
~ IT Optimizer ~

*• LOPSA Member #15248
*• Blog : http://pepoluan.tumblr.com
*• Linked-In : http://id.linkedin.com/in/pepoluan
 
Old 03-13-2012, 04:45 AM
Canek Pelez Valds
 
Default bindmount or symlink?

On Mon, Mar 12, 2012 at 11:39 PM, Pandu Poluan <pandu@poluan.info> wrote:
> On Tue, Mar 13, 2012 at 12:11, Canek Pelez Valds <caneko@gmail.com> wrote:
>> On Mon, Mar 12, 2012 at 11:04 PM, Pandu Poluan <pandu@poluan.info> wrote:
>>> I am seriously thinking of splitting the storage of directories under /usr,
>>> e.g., /usr/portage and /usr/source actually living somewhere else, on
>>> different partition and different filesystem. Let's say something mounted on
>>> /mnt/Persistent.
>>>
>>> My question: should I use bindmount or symlinks to do that? What's the
>>> drawbacks/benefits for either?
>>
>> I'm sorry, I don't understand. What's the problem of having the
>> following in /etc/fstab?
>>
>> LABEL=Portage * /usr/portage * * * * * *ext4 * * * * * *noatime,auto * * * * * * * * * *0 2
>> LABEL=Source * * * * * */usr/source * * * * * * ext4 * * * * * *noatime,auto * * * * * * * * * *0 2
>>
>> (Replace LABEL=Portage with /dev/sda7, if you want to.)
>>
>> Why do you need to bindmount or link the directories when you can
>> mount them wherever you want?
>>
>
> Because I am avoiding "single partition per directory". And a slight
> mistake in my original email, it's not just /usr but also /var (and
> other root-based directories that will not interfere with boot-up /
> operations)
>
> Let me give an example:
>
> Let's say I have /dev/sdc and /dev/sdd, both having single partition
> each (/dev/sdc1 and /dev/sdd1).
>
> /dev/sdc1 will be formatted reiserfs mounted into /mnt/Persistent1
>
> /dev/sdd1 will be formatted ext4 mounted into /mnt/Persistent2
>
> Directories not really necessary for daily operations, such as
> /usr/src, /usr/portage, /var/db/pkg, and so on and so forth, will each
> be a subdir under either /mnt/Persistent1 or /mnt/Persistent2
> according to each directory's nature.
>
> Let's take the example of /usr/src ... I can either make /usr/src a
> symlink to /mnt/Persistent1/src, or bindmount /mnt/Persistent1/src to
> /usr/src

All of that sounds incredible complicated. Interesting choice of
partition handling.


> What will be the benefits/drawbacks for bindmount vs symlink?

In my experience, and if you are not dealing with NFS, no respectable
program cares about a dir being a symlink, so I would use symlinks
(they are easier to handle).

Regards.
--
Canek Pelez Valds
Posgrado en Ciencia e Ingeniera de la Computacin
Universidad Nacional Autnoma de Mxico
 
Old 03-13-2012, 05:59 AM
Alan McKinnon
 
Default bindmount or symlink?

On Tue, 13 Mar 2012 12:04:00 +0700
Pandu Poluan <pandu@poluan.info> wrote:

> I am seriously thinking of splitting the storage of directories
> under /usr, e.g., /usr/portage and /usr/source actually living
> somewhere else, on different partition and different filesystem.
> Let's say something mounted on /mnt/Persistent.
>
> My question: should I use bindmount or symlinks to do that? What's the
> drawbacks/benefits for either?
>
> Rgds,

You should do neither as they do not give you split storage, they
both give you the same thing in two different places.

Create two new filesystems and mount them.

I personally use /var/portage as there is no good reason for it to be
under /usr where it is just clutter.

Code goes in /usr
Data goes in /var

You have to change PORTDIR in /etc/make.conf for this to work as well
as /etc/make.profile. Nothing breaks without it, you just get errors
from portage


--
Alan McKinnnon
alan.mckinnon@gmail.com
 
Old 03-13-2012, 07:05 AM
Pandu Poluan
 
Default bindmount or symlink?

On Mar 13, 2012 2:00 PM, "Alan McKinnon" <alan.mckinnon@gmail.com> wrote:

>

> On Tue, 13 Mar 2012 12:04:00 +0700

> Pandu Poluan <pandu@poluan.info> wrote:

>

> > I am seriously thinking of splitting the storage of directories

> > under /usr, e.g., /usr/portage and /usr/source actually living

> > somewhere else, on different partition and different filesystem.

> > Let's say something mounted on /mnt/Persistent.

> >

> > My question: should I use bindmount or symlinks to do that? What's the

> > drawbacks/benefits for either?

> >

> > Rgds,

>

> You should do neither as they do not give you split storage, they

> both give you the same thing in two different places.

>

> Create two new filesystems and mount them.

>

> I personally use /var/portage as there is no good reason for it to be

> under /usr where it is just clutter.

>

> Code goes in /usr

> Data goes in /var

>

> You have to change PORTDIR in /etc/make.conf for this to work as well

> as /etc/make.profile. Nothing breaks without it, you just get errors

> from portage

>


Eh? But I put portage, src, share, etc. on a different partition mounted under /mnt ... doesn't that mean I am using a split filesystem?


Rgds,
 
Old 03-13-2012, 07:15 AM
Canek Pelez Valds
 
Default bindmount or symlink?

On Tue, Mar 13, 2012 at 2:05 AM, Pandu Poluan <pandu@poluan.info> wrote:
>
> On Mar 13, 2012 2:00 PM, "Alan McKinnon" <alan.mckinnon@gmail.com> wrote:
>>
>> On Tue, 13 Mar 2012 12:04:00 +0700
>> Pandu Poluan <pandu@poluan.info> wrote:
>>
>> > I am seriously thinking of splitting the storage of directories
>> > under /usr, e.g., /usr/portage and /usr/source actually living
>> > somewhere else, on different partition and different filesystem.
>> > Let's say something mounted on /mnt/Persistent.
>> >
>> > My question: should I use bindmount or symlinks to do that? What's the
>> > drawbacks/benefits for either?
>> >
>> > Rgds,
>>
>> You should do neither as they do not give you split storage, they
>> both give you the same thing in two different places.
>>
>> Create two new filesystems and mount them.
>>
>> I personally use /var/portage as there is no good reason for it to be
>> under /usr where it is just clutter.
>>
>> Code goes in /usr
>> Data goes in /var
>>
>> You have to change PORTDIR in /etc/make.conf for this to work as well
>> as /etc/make.profile. Nothing breaks without it, you just get errors
>> from portage
>>
>
> Eh? But I put portage, src, share, etc. on a different partition mounted
> under /mnt ... doesn't that mean I am using a split filesystem?

You are; but in an incredible complicated and convulted way.

If I'm understanding you, you want:

fstab:
/dev/XX /mnt/p1 ...
/dev/YY /mnt/p2 ...

and then

/usr/portage -> /mnt/p1
/usr/src -> /mnt/p2

(or using bindmounting, whatever).

This makes no sense at all (at least not to me), when you can simply:

fstab:
/dev/XX /usr/portage ...
/dev/YY /usr/src ...

and get the same split filesystem, but without all the complication
you are proposing.

Unless there is something I don't understand, in which case I'm not
following your reasoning.

Regards.
--
Canek Pelez Valds
Posgrado en Ciencia e Ingeniera de la Computacin
Universidad Nacional Autnoma de Mxico
 
Old 03-13-2012, 07:52 AM
Philipp Riegger
 
Default bindmount or symlink?

On 13.03.2012 09:15, Canek Pelez Valds wrote:

If I'm understanding you, you want:

fstab:
/dev/XX /mnt/p1 ...
/dev/YY /mnt/p2 ...

and then

/usr/portage -> /mnt/p1
/usr/src -> /mnt/p2

(or using bindmounting, whatever).

This makes no sense at all (at least not to me), when you can simply:

fstab:
/dev/XX /usr/portage ...
/dev/YY /usr/src ...

and get the same split filesystem, but without all the complication
you are proposing.

Unless there is something I don't understand, in which case I'm not
following your reasoning.


There are 2 possible things one can do:

1) Split everything, /usr, /usr/src, /usr/portage each on a seperate
filesystem.
2) Seperate multiple paths from /usr: Have 1 fs /mnt/data and link (or
bind mount) /usr/src, /usr/portage there. You have a shared fs for dirx,
that are usually not shared.


What would be the benefits of symlinks and bind mounts for doing 2)?

Philipp
 
Old 03-13-2012, 08:00 AM
Pandu Poluan
 
Default bindmount or symlink?

On Tue, Mar 13, 2012 at 15:15, Canek Peláez Valdés <caneko@gmail.com> wrote:
>
> You are; but in an incredible complicated and convulted way.
>
> If I'm understanding you, you want:
>
> fstab:
> /dev/XX * /mnt/p1 * ...
> /dev/YY * /mnt/p2 * ...
>
> and then
>
> /usr/portage -> /mnt/p1
> /usr/src -> /mnt/p2
>
> (or using bindmounting, whatever).
>
> This makes no sense at all (at least not to me), when you can simply:
>
> fstab:
> /dev/XX * /usr/portage * ...
> /dev/YY * /usr/src * ...
>
> and get the same split filesystem, but without all the complication
> you are proposing.
>
> Unless there is something I don't understand, in which case I'm not
> following your reasoning.
>

The point is: It's not just 2 (two) directories, but several of them,
and I just can't see myself creating a partition (or an LV) for each
and everyone of them.

So, here's my thoughts:

There are 2 filesystems that are suitable for different purposes:
* reiserfs = for space efficiency (w/o notail option) and/or no inode#
limitation
* ext4 = for general purpose

The directories I'm going to split:

/usr/share ==> ext4
/usr/portage ==> reiserfs
/usr/portage/packages ==> ext4
/usr/portage/distfiles ==> ext4
/usr/src ==> reiserfs
/var/cache/rtorrent (don't ask) ==> reiserfs
/var/spool/postfix ==> ext4
/var/lib/postgresql ==> ext4

Now, I create 2 partitions:

/dev/sdc1 (reiserfs) --> /mnt/Persistent1
/dev/sdd1 (ext4) --> /mnt/Persistent2

Then I create subdirectories:

/mnt/Persistent1/portage
/mnt/Persistent1/src
/mnt/Persistent1/rtorrent

/mnt/Persistent2/share
/mnt/Persistent2/packages
/mnt/Persistent2/distfiles
/mnt/Persistent2/postfix
/mnt/Persistent2/postgresql

Finally, I need to redirect the directories-I-want-to-split to the
above subdirs under /mnt/Persistent[12]

SO.

mount -o bind ... or ln -s ?

Rgds,
--
FdS Pandu E Poluan
~ IT Optimizer ~

*• LOPSA Member #15248
*• Blog : http://pepoluan.tumblr.com
*• Linked-In : http://id.linkedin.com/in/pepoluan
 
Old 03-13-2012, 08:12 AM
Canek Pelez Valds
 
Default bindmount or symlink?

On Tue, Mar 13, 2012 at 3:00 AM, Pandu Poluan <pandu@poluan.info> wrote:
> On Tue, Mar 13, 2012 at 15:15, Canek Pelez Valds <caneko@gmail.com> wrote:
>>
>> You are; but in an incredible complicated and convulted way.
>>
>> If I'm understanding you, you want:
>>
>> fstab:
>> /dev/XX * /mnt/p1 * ...
>> /dev/YY * /mnt/p2 * ...
>>
>> and then
>>
>> /usr/portage -> /mnt/p1
>> /usr/src -> /mnt/p2
>>
>> (or using bindmounting, whatever).
>>
>> This makes no sense at all (at least not to me), when you can simply:
>>
>> fstab:
>> /dev/XX * /usr/portage * ...
>> /dev/YY * /usr/src * ...
>>
>> and get the same split filesystem, but without all the complication
>> you are proposing.
>>
>> Unless there is something I don't understand, in which case I'm not
>> following your reasoning.
>>
>
> The point is: It's not just 2 (two) directories, but several of them,
> and I just can't see myself creating a partition (or an LV) for each
> and everyone of them.
>
> So, here's my thoughts:
>
> There are 2 filesystems that are suitable for different purposes:
> * reiserfs = for space efficiency (w/o notail option) and/or no inode#
> limitation
> * ext4 = for general purpose
>
> The directories I'm going to split:
>
> /usr/share ==> ext4
> /usr/portage ==> reiserfs
> /usr/portage/packages ==> ext4
> /usr/portage/distfiles ==> ext4
> /usr/src ==> reiserfs
> /var/cache/rtorrent (don't ask) ==> reiserfs
> /var/spool/postfix ==> ext4
> /var/lib/postgresql ==> ext4
>
> Now, I create 2 partitions:
>
> /dev/sdc1 (reiserfs) --> /mnt/Persistent1
> /dev/sdd1 (ext4) --> /mnt/Persistent2
>
> Then I create subdirectories:
>
> /mnt/Persistent1/portage
> /mnt/Persistent1/src
> /mnt/Persistent1/rtorrent
>
> /mnt/Persistent2/share
> /mnt/Persistent2/packages
> /mnt/Persistent2/distfiles
> /mnt/Persistent2/postfix
> /mnt/Persistent2/postgresql
>
> Finally, I need to redirect the directories-I-want-to-split to the
> above subdirs under /mnt/Persistent[12]
>
> SO.
>
> mount -o bind ... or ln -s ?

OK, now I understand. I still think is kinda crazy, but to each its own.

I would definitely use symlinks.

Regards.
--
Canek Pelez Valds
Posgrado en Ciencia e Ingeniera de la Computacin
Universidad Nacional Autnoma de Mxico
 
Old 03-13-2012, 09:35 AM
Nilesh Govindrajan
 
Default bindmount or symlink?

On Mar 13, 2012 2:42 PM, "Canek Pelez Valds" <caneko@gmail.com> wrote:

>

> On Tue, Mar 13, 2012 at 3:00 AM, Pandu Poluan <pandu@poluan.info> wrote:

> > On Tue, Mar 13, 2012 at 15:15, Canek Pelez Valds <caneko@gmail.com> wrote:

> >>

> >> You are; but in an incredible complicated and convulted way.

> >>

> >> If I'm understanding you, you want:

> >>

> >> fstab:

> >> /dev/XX * /mnt/p1 * ...

> >> /dev/YY * /mnt/p2 * ...

> >>

> >> and then

> >>

> >> /usr/portage -> /mnt/p1

> >> /usr/src -> /mnt/p2

> >>

> >> (or using bindmounting, whatever).

> >>

> >> This makes no sense at all (at least not to me), when you can simply:

> >>

> >> fstab:

> >> /dev/XX * /usr/portage * ...

> >> /dev/YY * /usr/src * ...

> >>

> >> and get the same split filesystem, but without all the complication

> >> you are proposing.

> >>

> >> Unless there is something I don't understand, in which case I'm not

> >> following your reasoning.

> >>

> >

> > The point is: It's not just 2 (two) directories, but several of them,

> > and I just can't see myself creating a partition (or an LV) for each

> > and everyone of them.

> >

> > So, here's my thoughts:

> >

> > There are 2 filesystems that are suitable for different purposes:

> > * reiserfs = for space efficiency (w/o notail option) and/or no inode#

> > limitation

> > * ext4 = for general purpose

> >

> > The directories I'm going to split:

> >

> > /usr/share ==> ext4

> > /usr/portage ==> reiserfs

> > /usr/portage/packages ==> ext4

> > /usr/portage/distfiles ==> ext4

> > /usr/src ="" reiserfs

> > /var/cache/rtorrent (don't ask) ==> reiserfs

> > /var/spool/postfix ==> ext4

> > /var/lib/postgresql ==> ext4

> >

> > Now, I create 2 partitions:

> >

> > /dev/sdc1 (reiserfs) --> /mnt/Persistent1

> > /dev/sdd1 (ext4) --> /mnt/Persistent2

> >

> > Then I create subdirectories:

> >

> > /mnt/Persistent1/portage

> > /mnt/Persistent1/src

> > /mnt/Persistent1/rtorrent

> >

> > /mnt/Persistent2/share

> > /mnt/Persistent2/packages

> > /mnt/Persistent2/distfiles

> > /mnt/Persistent2/postfix

> > /mnt/Persistent2/postgresql

> >

> > Finally, I need to redirect the directories-I-want-to-split to the

> > above subdirs under /mnt/Persistent[12]

> >

> > SO.

> >

> > mount -o bind ... or ln -s ?

>

> OK, now I understand. I still think is kinda crazy, but to each its own.

>

> I would definitely use symlinks.

>

> Regards.

> --

> Canek Pelez Valds

> Posgrado en Ciencia e Ingeniera de la Computacin

> Universidad Nacional Autnoma de Mxico

>


For critically performance wise, I think bindmounts would do better because it is done at kernel level whereas symlinks will have to be resolved on access, no dobut a kernel maintains cache but I can't really say much about it because I don't know the code behind either.



--

Nilesh Govindrajan

http://nileshgr.com
 
Old 03-13-2012, 09:58 AM
Alan McKinnon
 
Default bindmount or symlink?

On Tue, 13 Mar 2012 15:05:59 +0700
Pandu Poluan <pandu@poluan.info> wrote:

> On Mar 13, 2012 2:00 PM, "Alan McKinnon" <alan.mckinnon@gmail.com>
> wrote:
> >
> > On Tue, 13 Mar 2012 12:04:00 +0700
> > Pandu Poluan <pandu@poluan.info> wrote:
> >
> > > I am seriously thinking of splitting the storage of directories
> > > under /usr, e.g., /usr/portage and /usr/source actually living
> > > somewhere else, on different partition and different filesystem.
> > > Let's say something mounted on /mnt/Persistent.
> > >
> > > My question: should I use bindmount or symlinks to do that?
> > > What's the drawbacks/benefits for either?
> > >
> > > Rgds,
> >
> > You should do neither as they do not give you split storage, they
> > both give you the same thing in two different places.
> >
> > Create two new filesystems and mount them.
> >
> > I personally use /var/portage as there is no good reason for it to
> > be under /usr where it is just clutter.
> >
> > Code goes in /usr
> > Data goes in /var
> >
> > You have to change PORTDIR in /etc/make.conf for this to work as
> > well as /etc/make.profile. Nothing breaks without it, you just get
> > errors from portage
> >
>
> Eh? But I put portage, src, share, etc. on a different partition
> mounted under /mnt ... doesn't that mean I am using a split
> filesystem?

Do you have separate filesystems for each of those directories, or one
big storage area? I'm struggling to find out what you are trying to
accomplish and what problem that is a solution for.


--
Alan McKinnnon
alan.mckinnon@gmail.com
 

Thread Tools




All times are GMT. The time now is 07:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org