Re: [gentoo-user] bindmount or symlink?
On Tue, 13 Mar 2012 12:04:00 +0700 Pandu Poluan pa...@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.mckin...@gmail.com
Re: [gentoo-user] bindmount or symlink?
On Mar 13, 2012 2:00 PM, Alan McKinnon alan.mckin...@gmail.com wrote: On Tue, 13 Mar 2012 12:04:00 +0700 Pandu Poluan pa...@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,
Re: [gentoo-user] bindmount or symlink?
On Tue, Mar 13, 2012 at 2:05 AM, Pandu Poluan pa...@poluan.info wrote: On Mar 13, 2012 2:00 PM, Alan McKinnon alan.mckin...@gmail.com wrote: On Tue, 13 Mar 2012 12:04:00 +0700 Pandu Poluan pa...@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 Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México
Re: [gentoo-user] bindmount or symlink?
On 13.03.2012 09:15, Canek Peláez Valdés 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
Re: [gentoo-user] bindmount or symlink?
On Tue, Mar 13, 2012 at 15:15, Canek Peláez Valdés can...@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
Re: [gentoo-user] bindmount or symlink?
On Tue, Mar 13, 2012 at 3:00 AM, Pandu Poluan pa...@poluan.info wrote: On Tue, Mar 13, 2012 at 15:15, Canek Peláez Valdés can...@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 Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México
Re: [gentoo-user] bindmount or symlink?
On Mar 13, 2012 2:42 PM, Canek Peláez Valdés can...@gmail.com wrote: On Tue, Mar 13, 2012 at 3:00 AM, Pandu Poluan pa...@poluan.info wrote: On Tue, Mar 13, 2012 at 15:15, Canek Peláez Valdés can...@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 Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México 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
Re: [gentoo-user] bindmount or symlink?
On Tue, 13 Mar 2012 15:05:59 +0700 Pandu Poluan pa...@poluan.info wrote: On Mar 13, 2012 2:00 PM, Alan McKinnon alan.mckin...@gmail.com wrote: On Tue, 13 Mar 2012 12:04:00 +0700 Pandu Poluan pa...@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.mckin...@gmail.com
Re: [gentoo-user] bindmount or symlink?
On Tue, 13 Mar 2012 16:00:08 +0700 Pandu Poluan pa...@poluan.info wrote: On Tue, Mar 13, 2012 at 15:15, Canek Peláez Valdés can...@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, Ah, now I see. You have many sub-directories of /usr that you don't want to be part of the same volume as /usr. This is quite valid, I can think of several lines of reasoning: - you'd rather not have the pain of dealing with many smaller filesystems even if LVM is available. - you just want a large storage area for stuffs, and don't feel like finding out how much space each one needs - you'd rather keep the bulk of /usr static and don't growing much So instead make two big mount points in /mnt, one each for the destination filesystem types you are interested in and link the subdirectories there to the right place in /usr. You want bindmounts for that. Someone else here (I forget whom) did the same thing with his home directories and /var. It's a valid need, but rare. And nobody else understood his reasoning for a long time either :-) OT: I can't wait for the day when ZFS- and btrfs-like filesystems are the norm and we can dispense with all this physical disk, partitions, LVM, volumes, file systems and mounting nonsense. I want this model: I have X bytes of storage, I would like Y bytes to be mounted here with these charactertics, and Z bytes mounted there with those characteristics. Kernel, make it so, thanksverymuch and have a nice day -- Alan McKinnnon alan.mckin...@gmail.com
Re: [gentoo-user] bindmount or symlink?
On Tue, Mar 13, 2012 at 12:04:00PM +0700, Pandu Poluan 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? There might be some really rare occasions when you boot up in rescue mode (single) where a program expects a directory. -- Walter Dnes waltd...@waltdnes.org
Re: [gentoo-user] bindmount or symlink?
On Mon, Mar 12, 2012 at 11:04 PM, Pandu Poluan pa...@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/portageext4noatime,auto 0 2 LABEL=Source/usr/source ext4noatime,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? Regards. -- Canek Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México
Re: [gentoo-user] bindmount or symlink?
On Tue, Mar 13, 2012 at 12:11, Canek Peláez Valdés can...@gmail.com wrote: On Mon, Mar 12, 2012 at 11:04 PM, Pandu Poluan pa...@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
Re: [gentoo-user] bindmount or symlink?
On Mon, Mar 12, 2012 at 11:39 PM, Pandu Poluan pa...@poluan.info wrote: On Tue, Mar 13, 2012 at 12:11, Canek Peláez Valdés can...@gmail.com wrote: On Mon, Mar 12, 2012 at 11:04 PM, Pandu Poluan pa...@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 Peláez Valdés Posgrado en Ciencia e Ingeniería de la Computación Universidad Nacional Autónoma de México