On Sun, Nov 27, 2011 at 01:22, Mick <michaelkintz...@gmail.com> wrote:
> On Friday 25 Nov 2011 20:08:01 Walter Dnes wrote:
>> On Fri, Nov 25, 2011 at 11:12:42PM +0700, Pandu Poluan wrote
>>
>> > Everytime I read some guide on LVM, my eyes becomes blurry, the room
>> > starts spinning, and I can hear wolves howling ... :D
>> >
>> > Seriously, LVM looks mighty nice, but it also looks (and is!) mighty
>> > complex.
>> >
>> > So, I want to start from something simple.
>> >
>> > Aaaanyways, after reviewing my production boxes, I decided to
>> > implement the following strategy:
>> >
>> > /  == 800 MiB
>> > /boot == 20 MiB
>> > /usr == 1800 MiB
>> > /usr/portage == 2000 MiB
>> > /var == 4000 MiB
>> > /var/lib/postgresql == 1000 MiB
>> >
>> > Comments, suggestions, are welcome :)
>>
>>   I have my own weird approach that's even weirder than my mdev setup<G>.
>> I start with...
>> * 250 megabytes for / as ext2fs (No that is not a typo)
>> * 4 gigs for swap
>> * the rest of the drive is /home as one huge reiserfs partition
>>
>>   And I do *NOT* use LVM.  "fdisk -l" shows...
>>
>>    Device Boot      Start         End      Blocks   Id  System
>> /dev/sda1            2048   976773167   488385560    5  Extended
>> /dev/sda5            4096      516095      256000   83  Linux
>> /dev/sda6          518144     8906751     4194304   83  Linux
>> /dev/sda7         8908800   976773167   483932184   83  Linux
>>
>> "df" shows
>>
>> Filesystem           1K-blocks      Used Available Use% Mounted on
>> rootfs                  247919     29315    205804  13% /
>> /dev/root               247919     29315    205804  13% /
>> devtmpfs                 10240         0     10240   0% /dev
>> rc-svcdir                 1024        44       980   5% /lib/rc/init.d
>> mdev                     10240         0     10240   0% /dev
>> shm                    1551308         0   1551308   0% /dev/shm
>> /dev/sda7            483917384 251951296 231966088  53% /home
>>
>>   The secret is that I bindmount /opt, /var, /usr, and /tmp onto the
>> large reiserfs partition.
>>
> ###########################################################################
>> ### /dev/sda5               /         ext2     noatime,nodiratime,async
>>    0 1 /dev/sda7               /home     reiserfs
>> noatime,nodiratime,async,notail 0 1 /home/bindmounts/opt    /opt      auto
>>     bind                            0 0 /home/bindmounts/var    /var
>> auto     bind                            0 0 /home/bindmounts/usr    /usr
>>     auto     bind                            0 0 /home/bindmounts/tmp
>> /tmp      auto     bind                            0 0 /dev/sda6
>>     none            swap            sw              0 0 /dev/cdrom
>>      /mnt/cdrom      iso9660         noauto,users,ro 0 0 /dev/cdrom1
>>       /mnt/cdrom1     auto            noauto,user,ro  0 0 /dev/sdb1
>>  /mnt/extb       auto  noauto,user,noatime,async       0 0 /dev/sdc1
>>   /mnt/extc       auto  noauto,user,noatime,async       0 0
>>
>> # glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
>> # POSIX shared memory (shm_open, shm_unlink).
>> # (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
>> #  use almost no memory if not populated with files)
>> shm               /dev/shm        tmpfs nodev,nosuid,noexec       0 0
>>
> ###########################################################################
>> ###
>
> I recall your interesting mounting approach, but never really understood the
> benefit of it.  Would you please explain why you use bindmount?
>

Not really explaining waltdnes' interesting layout, but using
bindmount (instead of symlinks) ensures that when a program tries to
find a relative directory from a path, it will not attempt to do so
from the symlink's target.

E.g.:

Say I have /lib/gzampl/, which is actually a symlink/bindmount to
/mnt/gzampl/. Then theres another directory /lib/morethings. With a
symlink, if a program wants to do "../morethings" from within
/lib/gzampl/, it might end up in /mnt/morethings if the program tries
to resolve the symlink first. With a bindmount, doing "../morethings"
from /lib/gzampl/ will always end up in /lib/morethings.

(CMIIW)

That said... mentioning bindmount made me rethink things...

What if I have:

/mnt/.temporaries ==> ext4, 4GiB
/mnt/.persistents ==> reiserfs, 2GiB

then I make some directories and bindmounts:

/mnt/.temporaries/tmp --bm--> /tmp
/mnt/.temporaries/vartmp --bm--> /var/tmp
/mnt/.temporaries/run --bm--> /run
/run --bm--> /var/run
/run/lock --bm--> /var/lock
/mnt/.persistents/postgresql --bm--> /var/lib/postgresql
/mnt/.persistents/vardb --bm--> /var/db
/mnt/.persistents/varlog --bm--> /var/log
/mnt/.persistents/varspool --bm--> /var/spool

Ta da! The ephemeral directories can now just fight among themselves,
and the important directories can be backed up in one fell swoop (via
/mnt/.persistents)?

Thoughts are welcome, of course :)

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

 • LOPSA Member #15248
 • Blog : http://pepoluan.tumblr.com
 • Linked-In : http://id.linkedin.com/in/pepoluan

Reply via email to