Linux Partitioning Layout - Setup

This is a discussion on Linux Partitioning Layout - Setup ; I need help with partitioning DELL PowerEdge 2950 server (web application and database production server - Linux, Apache, PHP,MySQL) It has 16GB memory Primary Controller PERC6i SAS RAID Controller I am trying to install CentOS 5.2 and I have just ...

+ Reply to Thread
Results 1 to 19 of 19

Thread: Linux Partitioning Layout

  1. Linux Partitioning Layout

    I need help with partitioning DELL PowerEdge 2950 server
    (web application and database production server - Linux, Apache,
    PHP,MySQL)
    It has 16GB memory
    Primary Controller PERC6i SAS RAID Controller

    I am trying to install CentOS 5.2 and I have just arrived to the point
    where I am to create partitioning for:

    sda 146GB (2 x 146GB Serial-Attach SCSI) hardware RAID 1
    sdb 146GB (4 x 73GB Serial-Attach SCSI) hardware RAID 10

    What Partitioning Scheme would you recommend?
    So far I have this

    ======================================
    Device Mount Point File System Type Size

    /dev/sda /boot ext3 100 MB

    /dev/sdb /swap ext3 16 GB

    I do not know where to create the following mount points and at what
    sizes and whether I even need all of those
    /
    /var
    /usr
    /home
    /tmp
    /proc
    /opt

    Thank you

  2. Re: Linux Partitioning Layout

    bob wrote:

    > What Partitioning Scheme would you recommend?
    > So far I have this
    >
    > ======================================
    > Device Mount Point File System Type Size
    >
    > /dev/sda /boot ext3 100 MB
    >
    > /dev/sdb /swap ext3 16 GB


    Bloody hell. Your swap file is big. I would reduce that down. This is
    not Microsoft Windows.

    I would create /usr at 32 Gb

    I would probably create /opt at 16 Gb, if this is the primary
    application server. (I use /opt here for network shared applications.)

    and use /local for the rest of the disk.

    I would then use symlinks to map /home, /var, and /tmp to subdirectories
    of /local

    The /proc filesystem is virtual and does not use diskspace.

    Mark.

    --
    Mark Hobley,
    393 Quinton Road West,
    Quinton, BIRMINGHAM.
    B32 1QE.

  3. Re: Linux Partitioning Layout

    bob wrote:
    > I need help with partitioning DELL PowerEdge 2950 server
    > (web application and database production server - Linux, Apache,
    > PHP,MySQL)
    > It has 16GB memory
    > Primary Controller PERC6i SAS RAID Controller
    >
    > I am trying to install CentOS 5.2 and I have just arrived to the point
    > where I am to create partitioning for:
    >
    > sda 146GB (2 x 146GB Serial-Attach SCSI) hardware RAID 1
    > sdb 146GB (4 x 73GB Serial-Attach SCSI) hardware RAID 10
    >
    > What Partitioning Scheme would you recommend?
    > So far I have this
    >
    > ======================================
    > Device Mount Point File System Type Size
    >
    > /dev/sda /boot ext3 100 MB
    >
    > /dev/sdb /swap ext3 16 GB
    >
    > I do not know where to create the following mount points and at what
    > sizes and whether I even need all of those
    > /
    > /var
    > /usr
    > /home
    > /tmp
    > /proc
    > /opt
    >
    > Thank you


    OK, now we're into a religious subject, one involved in great movements and
    history and heresies, I say, heresies.

    / - be generous. 20 Gig, minimum, in case you need to do bulky things like
    download a DVD or some crappy installation software puts things in unexpected
    places. (Oracle used to be horrid about this.)

    Swap - 16 Gig

    /proc - that's a fake sort of filesystem, a hook into the kernel where it
    publishes and receives information about itself as files. No space is
    allocated for it.

    /boot - old grub and LILO boot partition, occasionally useful if you want / to
    be an exotic filesyste like reiserfs (which I don't recommend: use ext3). 100
    Meg is typical.

    /tmp, /usr/tmp, /var/tmp - Only make partitions and space for these if you're
    trying to minimize /. Modern backup systems will skip these gracefully, so no
    need to worry about putting them on their own partition to avoid backups

    /usr - Modern systems are *unhappy* if /usr is another partition, because if
    you can't mount /usr, you can't mount /usr/bin/. It can be done, but there's
    really a great point to it when disk is so cheap.

    /home - depends on your uses. If people need to do develpment in their home
    directory, and you want a separate backup schedule, fine.

    /var - depends on how much actual data you're storing, and if you want to
    protect / from overflowing /var. Typically, it's better to make a partition
    for /var/spool or /var/lib/mysql or /var/www, and allocate those for your
    specific tasks, to avoid overflow surprises.

    /opt - Unless you're installing Oracle, or other commercial packages, don't
    bother.

    But leave yourself your spare space for expansion, or projects. You can
    comfortably run a quite flexible and powerful RHEL 5, or CentOS 5, on a single
    20 Gig partition for / with a few gig for swap.

  4. Re: Linux Partitioning Layout

    Mark Hobley wrote:
    > bob wrote:
    >
    >> What Partitioning Scheme would you recommend?
    >> So far I have this
    >>
    >> ======================================
    >> Device Mount Point File System Type Size
    >>
    >> /dev/sda /boot ext3 100 MB
    >>
    >> /dev/sdb /swap ext3 16 GB

    >
    > Bloody hell. Your swap file is big. I would reduce that down. This is
    > not Microsoft Windows.
    >
    > I would create /usr at 32 Gb
    >
    > I would probably create /opt at 16 Gb, if this is the primary
    > application server. (I use /opt here for network shared applications.)
    >
    > and use /local for the rest of the disk.
    >
    > I would then use symlinks to map /home, /var, and /tmp to subdirectories
    > of /local
    >
    > The /proc filesystem is virtual and does not use diskspace.
    >
    > Mark.
    >

    Well here, on Debian, I have a separate /var. because thats where all
    the Mysql and web server stuff goes. Arguably more significant than the
    /home.

    I don't think there IS a /opt..oh its there, but its empty.



    heres a df -h

    dev/hda1 250M 170M 68M 72% /
    tmpfs 253M 0 253M 0% /lib/init/rw
    udev 10M 68K 10M 1% /dev
    tmpfs 253M 4.0K 253M 1% /dev/shm
    /dev/hda9 64G 29G 33G 48% /home
    /dev/hda8 361M 8.1M 334M 3% /tmp
    /dev/hda5 4.6G 730M 3.7G 17% /usr
    /dev/hda6 2.8G 1.1G 1.6G 42% /var
    /dev/hdb1 74G 31G 39G 45% /backup
    /dev/hdb2 74G 180M 70G 1% /backup2


    the /backup* are as separate disk keeping backups of the primary, and a
    bit of space for other machines that I haven't sorted yet.


  5. Re: Linux Partitioning Layout

    bob wrote:
    > I need help with partitioning DELL PowerEdge 2950 server
    > (web application and database production server - Linux, Apache,
    > PHP,MySQL)
    > It has 16GB memory
    > Primary Controller PERC6i SAS RAID Controller
    >
    > I am trying to install CentOS 5.2 and I have just arrived to the point
    > where I am to create partitioning for:
    >
    > sda 146GB (2 x 146GB Serial-Attach SCSI) hardware RAID 1
    > sdb 146GB (4 x 73GB Serial-Attach SCSI) hardware RAID 10
    >
    > What Partitioning Scheme would you recommend?
    > So far I have this
    >
    > ======================================
    > Device Mount Point File System Type Size
    >
    > /dev/sda /boot ext3 100 MB
    >
    > /dev/sdb /swap ext3 16 GB
    >
    > I do not know where to create the following mount points and at what
    > sizes and whether I even need all of those
    > /
    > /var
    > /usr
    > /home
    > /tmp
    > /proc
    > /opt
    >
    > Thank you


    First of all, if you want to use a swap partition, it should not be ext3
    (83), but swap (82). It should not be mounted. Thus, one of my hard drives
    looks like this:

    Disk /dev/sda: 73.5 GB, 73557090304 bytes
    255 heads, 63 sectors/track, 8942 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

    Device Boot Start End Blocks Id System
    /dev/sda1 * 1 13 104391 83 Linux
    /dev/sda2 14 2102 16779892+ 83 Linux
    /dev/sda3 2103 2624 4192965 83 Linux
    /dev/sda4 2625 8942 50749335 5 Extended
    /dev/sda5 2625 4191 12586896 83 Linux
    /dev/sda6 4192 5235 8385898+ 83 Linux
    /dev/sda7 5236 5757 4192933+ 83 Linux
    /dev/sda8 5758 6279 4192933+ 83 Linux
    /dev/sda9 6280 6534 2048256 82 Linux swap / Solaris

    Since I have 6 hard drives, I have not had to worry much about the sizes of
    the partitions.

    Second, you will want a partition for the / file system, and you do not seem
    to have one. I suggest you make one on the same drive as the /boot
    partition, and name it / .

    Thus, you might end up with two partitions, as you have now, but they would be

    /
    and
    swap

    With a normal installer for Linux, all the other items would be mounted in
    the / partition.

    This is the easiest way to do things (though not necessarily the best.)

    My /etc/fstab looks like this. Recall I have 6 hard drives. With only one or
    two hard drives, it might be a lottle simpler.

    LABEL=/ / ext3 defaults 1 1
    LABEL=/boot1 /boot ext3 defaults 1 2
    devpts /dev/pts devpts gid=5,mode=620 0 0
    tmpfs /dev/shm tmpfs defaults 0 0
    LABEL=/home /home ext3 defaults 1 2
    LABEL=/home/boinc /home/boinc ext3 defaults 1 2
    LABEL=/homeB /homeB ext3 defaults 1 2
    LABEL=/opt /opt ext3 defaults 1 2
    proc /proc proc defaults 0 0
    LABEL=/srv/dbms/dataA /srv/dbms/dataA ext2 defaults,noatime 1 2
    LABEL=/srv/dbms/dataB /srv/dbms/dataB ext2 defaults,noatime 1 2
    LABEL=/srv/dbms/dataC /srv/dbms/dataC ext2 defaults,noatime 1 2
    LABEL=/srv/dbms/dataD /srv/dbms/dataD ext2 defaults,noatime 1 2
    LABEL=/srv/dbms/dataE /srv/dbms/dataE ext2 defaults,noatime 1 2
    LABEL=/srv/dbms/dataF1 /srv/dbms/dataF ext2 defaults,noatime 1 2
    sysfs /sys sysfs defaults 0 0
    LABEL=/tmp /tmp ext3 defaults 1 2
    LABEL=/usr /usr ext3 defaults 1 2
    LABEL=/usr/local /usr/local ext3 defaults 1 2
    LABEL=/usr/src /usr/src ext3 defaults 1 2
    LABEL=/var /var ext3 defaults 1 2

    LABEL=SWAP-sdb8 swap swap defaults,pri=16 0 0
    LABEL=SWAP-sda9 swap swap defaults,pri=16 0 0

    $ df
    Filesystem 1K-blocks Used Available Use% Mounted on
    /dev/sda3 4061572 348216 3503708 10% /
    /dev/sda1 101086 20432 75435 22% /boot
    tmpfs 4092620 0 4092620 0% /dev/shm
    /dev/sda5 12192608 4057040 7506224 36% /home
    /dev/sdb1 16253924 1803928 13611004 12% /home/boinc
    /dev/sdb5 16253924 1605772 13809160 11% /homeB
    /dev/sdb2 6092388 1014800 4763116 18% /opt
    /dev/sda8 4061540 1662048 2189848 44% /srv/dbms/dataA
    /dev/sdb7 4061540 80448 3771448 3% /srv/dbms/dataB
    /dev/sdc1 17390224 243568 16249028 2% /srv/dbms/dataC
    /dev/sdd1 17390224 401376 16091220 3% /srv/dbms/dataD
    /dev/sde1 17390224 512928 15979668 4% /srv/dbms/dataE
    /dev/sdf1 17390224 403680 16088916 3% /srv/dbms/dataF
    /dev/sda6 8123168 149856 7554020 2% /tmp
    /dev/sda2 16253956 3622784 11792180 24% /usr
    /dev/sda7 4061540 124648 3727248 4% /usr/local
    /dev/sdb3 4061572 136172 3715752 4% /usr/src
    /dev/sdb6 12192608 366644 11196620 4% /var



    --
    .~. Jean-David Beyer Registered Linux User 85642.
    /V\ PGP-Key: 9A2FC99A Registered Machine 241939.
    /( )\ Shrewsbury, New Jersey http://counter.li.org
    ^^-^^ 07:20:01 up 1 day, 8:22, 3 users, load average: 4.25, 4.06, 4.02

  6. Re: Linux Partitioning Layout

    On Thu, 25 Sep 2008 23:26:25 -0400, bob wrote:

    > I do not know where to create the following mount points and at what
    > sizes and whether I even need all of those


    First, I strongly recommend using lvm, so you can easily shrink one
    filesystem, and increase another, without having to move any data,
    just in case you find your initial sizes are not suitable for your
    needs.

    I keep / and /var/log on regular partitions to make it easy to
    access them from a livecd, such as knoppix. As such, I'm using
    four partitions for each distribution I have installed. The
    following shows what I'm using for my current main disto, Mandriva
    2008.1 ...

    # swapon -s
    Filename Type Size Used Priority
    /dev/hda10 partition 3140668 0 1

    # sfdisk -l -uM /dev/hda
    Device Boot Start End MiB #blocks Id System
    /dev/hda10 139902+ 142969- 3068- 3140676 82 Linux swap / Solaris
    /dev/hda14 311408+ 312428- 1020- 1044193+ 83 Linux
    /dev/hda15 312428+ 312553- 126- 128488+ 83 Linux
    /dev/hda16 312553+ 345319- 32766- 33551721 8e Linux LVM

    # df
    Filesystem Size Used Avail Use% Mounted on
    /dev/hda14 1020M 516M 505M 51% /
    /dev/mapper/81-home 508M 240M 269M 48% /home
    /dev/mapper/81-opt 1.5G 325M 1.2G 22% /opt
    /dev/mapper/81-tmp 6.0G 4.5M 6.0G 1% /tmp
    /dev/mapper/81-usr 16G 12G 4.9G 70% /usr
    /dev/mapper/81-var 12G 5.1G 7.0G 42% /var
    /dev/hda15 126M 46M 80M 37% /var/log
    /dev/mapper/81-mnt 3.9M 70K 3.7M 2% /var/mnt
    /dev/mapper/81-data 48G 29G 20G 60% /var/mnt/data

    Most of the directories in my /home/dave directory are
    symlinked to directories in /var/mnt/data, which is a
    luks encrypted filesystem, mounted by my ~/.bash_profile.

    The swap size depends on whether or not you will be using
    suspend to disk. If you will, then the swap should be a
    little larger than the ram size, otherwise, 2GB is plenty.
    I set mine at 3, but have never seen more than 2GB used.
    (I have 2GB of ram).

    By using LVM, I can easily shrink /var, and increase /opt,
    if needed, without having to move data. Also, if I run
    out of space, I can add an new hd, and extend the existing
    filesystems, using the new hd, again, without having to
    move any data.

    I've symlinked /mnt, and /media to /var/mnt, which is on
    it's own filesystem, so that, if I try to copy a large
    file to a filesystem that is not normally mounted, and
    that I've forgotten to mount, I'll fill the tiny /var/mnt
    filesystem, instead of the / filesystem.

    Regards, Dave Hodgins

    --
    Change nomail.afraid.org to ody.ca to reply by email.
    (nomail.afraid.org has been set up specifically for
    use in usenet. Feel free to use it yourself.)

  7. Re: Linux Partitioning Layout

    Mark Hobley wrote:
    > bob wrote:
    >
    >> What Partitioning Scheme would you recommend?
    >> So far I have this
    >>
    >> ======================================
    >> Device Mount Point File System Type Size
    >>
    >> /dev/sda /boot ext3 100 MB
    >>
    >> /dev/sdb /swap ext3 16 GB

    >
    > Bloody hell. Your swap file is big. I would reduce that down. This is
    > not Microsoft Windows.
    >
    > I would create /usr at 32 Gb
    >
    > I would probably create /opt at 16 Gb, if this is the primary
    > application server. (I use /opt here for network shared applications.)
    >
    > and use /local for the rest of the disk.
    >
    > I would then use symlinks to map /home, /var, and /tmp to subdirectories
    > of /local


    Never pull that stunt. Why? Because the 'pwd' command returns different
    information for your working directory if you are using /bin/pwd or the shell
    built-in pwd command, and $PWD not be the same thing as `/bin/pwd`. This way
    lies madness, because this command becomes environment sensitive.

    cd /home/$LOGNAME/bin/ # /home is symlinked to /local/users
    cd ../..
    pwd


    > The /proc filesystem is virtual and does not use diskspace.
    >
    > Mark.
    >


  8. Re: Linux Partitioning Layout

    Thanks everybody.
    Please keep in mind that this is not a home server,
    I am planning this layout for PRODUCTION SERVER(Linux,Apache,
    PHP,MySQL) - about 4 websites with MySQL backend
    and around 10 websites with static content.

    Based on your advice and some googling I have this layout so far.
    Please feel free to critize it( + explanation so we all can learn
    something)

    ================================================== ====================
    Device | Mount Point | File System | Size | My_Info
    ================================================== ====================
    "RAID 1"(hardware RAID) capacity 146GB (2 x 146GB Serial-Attach SCSI)

    /dev/sda1 /boot ext3 100 MB
    /dev/sda2 / ext3 40 GB
    /dev/sda3 /swap swap 16 GB
    /dev/sda4 /home ext3 40 GB



    on "RAID 10"(hardware RAID) capacity 146GB (4 x 73GB Serial-Attach
    SCSI)
    I create separate partitions for security(and protect from
    overflowing)
    and performance reasons.

    /dev/sdb1 /tmp ext3 5 GB

    /dev/sdb2 /var ext3 20 GB
    /dev/sdb3 /var/tmp ext3 5 GB

    /dev/sdb4 /var/lib/mysql ext3 60 GB Log files,
    databases
    /dev/sdb5 /var/log/mysql ext3 20 GB

    /dev/sdb6 /var/spool ext3 10 GB

  9. Re: Linux Partitioning Layout

    bob wrote:
    > Thanks everybody.
    > Please keep in mind that this is not a home server,
    > I am planning this layout for PRODUCTION SERVER(Linux,Apache,
    > PHP,MySQL) - about 4 websites with MySQL backend
    > and around 10 websites with static content.
    >
    > Based on your advice and some googling I have this layout so far.
    > Please feel free to critize it( + explanation so we all can learn
    > something)
    >
    > ================================================== ====================
    > Device | Mount Point | File System | Size | My_Info
    > ================================================== ====================
    > "RAID 1"(hardware RAID) capacity 146GB (2 x 146GB Serial-Attach SCSI)
    >
    > /dev/sda1 /boot ext3 100 MB
    > /dev/sda2 / ext3 40 GB
    > /dev/sda3 /swap swap 16 GB
    > /dev/sda4 /home ext3 40 GB
    >
    >
    >
    > on "RAID 10"(hardware RAID) capacity 146GB (4 x 73GB Serial-Attach
    > SCSI)
    > I create separate partitions for security(and protect from
    > overflowing)
    > and performance reasons.
    >
    > /dev/sdb1 /tmp ext3 5 GB
    >
    > /dev/sdb2 /var ext3 20 GB
    > /dev/sdb3 /var/tmp ext3 5 GB
    >
    > /dev/sdb4 /var/lib/mysql ext3 60 GB Log files,
    > databases
    > /dev/sdb5 /var/log/mysql ext3 20 GB
    >
    > /dev/sdb6 /var/spool ext3 10 GB


    OK, stop right there. I see potential overpartitioning. You need to decide how
    much resources you really need before overdoing it. For example, if /tmp
    failes to be mountable at boot time, you're still going to have files
    generated there. And they'll be unreachable after /dev/sdb1 gets mounted on
    top of it.

    If you really need it, fine, but overpartitioning can cause as much or more
    trouble than can partitions overflowing /

  10. Re: Linux Partitioning Layout

    Nico Kadel-Garcia wrote:
    >
    > /var - depends on how much actual data you're storing, and if you want to
    > protect / from overflowing /var. Typically, it's better to make a partition
    > for /var/spool or /var/lib/mysql or /var/www, and allocate those for your
    > specific tasks, to avoid overflow surprises.
    >
    > /opt - Unless you're installing Oracle, or other commercial packages, don't
    > bother.


    Writing as an SA whose systems usually do run Oracle, I
    tend to build a /u01 for Oracle binaries and data and leave
    /opt in root for apps from the distro vendor.

    Writing as an SA who is paranoid about filling up disk space
    with log files, I make /var a separate partition and sometimes
    even link log file stuff to it.

  11. Re: Linux Partitioning Layout

    bob wrote:
    > Thanks everybody.
    > Please keep in mind that this is not a home server,
    > I am planning this layout for PRODUCTION SERVER(Linux,Apache,
    > PHP,MySQL) - about 4 websites with MySQL backend
    > and around 10 websites with static content.
    >
    > Based on your advice and some googling I have this layout so far.
    > Please feel free to critize it( + explanation so we all can learn
    > something)
    >
    > ================================================== ====================
    > Device | Mount Point | File System | Size | My_Info
    > ================================================== ====================
    > "RAID 1"(hardware RAID) capacity 146GB (2 x 146GB Serial-Attach SCSI)
    >
    > /dev/sda1 /boot ext3 100 MB
    > /dev/sda2 / ext3 40 GB
    > /dev/sda3 /swap swap 16 GB


    NO: swap does not get mounted.

    > /dev/sda4 /home ext3 40 GB
    >
    >
    >
    > on "RAID 10"(hardware RAID) capacity 146GB (4 x 73GB Serial-Attach
    > SCSI)
    > I create separate partitions for security(and protect from
    > overflowing)
    > and performance reasons.
    >
    > /dev/sdb1 /tmp ext3 5 GB
    >
    > /dev/sdb2 /var ext3 20 GB
    > /dev/sdb3 /var/tmp ext3 5 GB
    >
    > /dev/sdb4 /var/lib/mysql ext3 60 GB Log files,
    > databases
    > /dev/sdb5 /var/log/mysql ext3 20 GB
    >
    > /dev/sdb6 /var/spool ext3 10 GB



    --
    .~. Jean-David Beyer Registered Linux User 85642.
    /V\ PGP-Key: 9A2FC99A Registered Machine 241939.
    /( )\ Shrewsbury, New Jersey http://counter.li.org
    ^^-^^ 12:15:01 up 1 day, 13:17, 3 users, load average: 5.47, 4.82, 4.79

  12. Re: Linux Partitioning Layout

    Nico Kadel-Garcia wrote:

    > Never pull that stunt. Why? Because the 'pwd' command returns different
    > information for your working directory if you are using /bin/pwd or the shell
    > built-in pwd command, and $PWD not be the same thing as `/bin/pwd`. This way
    > lies madness, because this command becomes environment sensitive.


    You are right that the GNU coreutils /bin/pwd returns /local/home,
    whereas the shell pwd returns /home.

    I have never had a problem relating to this. What problems does this cause?

    Mark.

    --
    Mark Hobley,
    393 Quinton Road West,
    Quinton, BIRMINGHAM.
    B32 1QE.

  13. Re: Linux Partitioning Layout

    Mark Hobley wrote:
    > Nico Kadel-Garcia wrote:
    >
    >> Never pull that stunt. Why? Because the 'pwd' command returns different
    >> information for your working directory if you are using /bin/pwd or the shell
    >> built-in pwd command, and $PWD not be the same thing as `/bin/pwd`. This way
    >> lies madness, because this command becomes environment sensitive.

    >
    > You are right that the GNU coreutils /bin/pwd returns /local/home,
    > whereas the shell pwd returns /home.
    >
    > I have never had a problem relating to this. What problems does this cause?
    >
    > Mark.
    >

    trillian:jdbeyer[~]$ pwd
    /home/jdbeyer
    trillian:jdbeyer[~]$ /bin/pwd
    /home/jdbeyer
    trillian:jdbeyer[~]$ cd ..
    trillian:jdbeyer[/home]$ pwd
    /home
    trillian:jdbeyer[/home]$ /bin/pwd
    /home
    trillian:jdbeyer[/home]$ rpm -qf /bin/pwd
    coreutils-5.97-14.el5


    --
    .~. Jean-David Beyer Registered Linux User 85642.
    /V\ PGP-Key: 9A2FC99A Registered Machine 241939.
    /( )\ Shrewsbury, New Jersey http://counter.li.org
    ^^-^^ 17:10:01 up 1 day, 18:12, 4 users, load average: 4.27, 4.08, 4.07

  14. Re: Linux Partitioning Layout

    On Fri, 26 Sep 2008 17:13:03 -0400, Jean-David Beyer wrote:

    > trillian:jdbeyer[~]$ pwd
    > /home/jdbeyer
    > trillian:jdbeyer[~]$ /bin/pwd
    > /home/jdbeyer


    You missed the point. The difference occurs when a symlink is involved ...
    $ cd
    $ ll data
    lrwxrwxrwx 1 dave dave 13 2008-04-21 13:56 data -> /var/mnt/data/
    $ cd data
    $ pwd
    /home/dave/data
    $ /bin/pwd
    /var/mnt/data

    Regards, Dave Hodgins

    --
    Change nomail.afraid.org to ody.ca to reply by email.
    (nomail.afraid.org has been set up specifically for
    use in usenet. Feel free to use it yourself.)

  15. Re: Linux Partitioning Layout

    Mark writes:
    > You are right that the GNU coreutils /bin/pwd returns /local/home,
    > whereas the shell pwd returns /home.


    'pwd -P' will return /local/home. From the bash manual:

    pwd [-LP]
    Print the absolute pathname of the current working directory.
    The pathname printed contains no symbolic links if the -P
    option is supplied or the -o physical option to the set
    builtin command is enabled. If the -L option is used, the
    pathname printed may contain symbolic links. The return
    status is 0 unless an error occurs while reading the name of
    the current directory or an invalid option is supplied.

    --
    John Hasler
    john@dhh.gt.org
    Dancing Horse Hill
    Elmwood, WI USA

  16. Re: Linux Partitioning Layout

    I demand that bob may or may not have written...

    > Thanks everybody.
    > Please keep in mind that this is not a home server,
    > I am planning this layout for PRODUCTION SERVER (Linux, Apache, PHP, MySQL)
    > - about 4 websites with MySQL backend and around 10 websites with static
    > content.


    > Based on your advice and some googling I have this layout so far. Please
    > feel free to critize it( + explanation so we all can learn something)


    > ================================================== ====================
    > Device | Mount Point | File System | Size | My_Info
    > ================================================== ====================
    > "RAID 1"(hardware RAID) capacity 146GB (2 x 146GB Serial-Attach SCSI)


    > /dev/sda1 /boot ext3 100 MB


    ext2 is adequate for /boot; writing to it will be rare and filesystem checks
    will be fast enough.

    > /dev/sda2 / ext3 40 GB
    > /dev/sda3 /swap swap 16 GB


    Swap is never mounted, but you still need to specify a "mount point"; it
    doesn't matter if it doesn't actually exist.

    > /dev/sda4 /home ext3 40 GB


    > on "RAID 10"(hardware RAID) capacity 146GB (4 x 73GB Serial-Attach SCSI) I
    > create separate partitions for security(and protect from overflowing) and
    > performance reasons.


    > /dev/sdb1 /tmp ext3 5 GB


    You should use tmpfs for /tmp rather than allocating a partition for it. That
    way, main memory and, possibly, swap will be used as needed.

    > /dev/sdb2 /var ext3 20 GB
    > /dev/sdb3 /var/tmp ext3 5 GB


    Same applies for /var/tmp.

    > /dev/sdb4 /var/lib/mysql ext3 60 GB Log files, databases
    > /dev/sdb5 /var/log/mysql ext3 20 GB
    > /dev/sdb6 /var/spool ext3 10 GB


    Not possible: you're limited to four primary partitions. For this, you'll
    need to make sdb4 an extended partition, which should be doable by creating
    logical partitions. (This means that you'll be using sdb5, sdb6 and sdb7
    instead.)

    --
    | Darren Salt | linux or ds at | nr. Ashington, | Toon
    | RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
    | + Burn less waste. Use less packaging. Waste less. USE FEWER RESOURCES.

    Never invest in anything that eats.

  17. Re: Linux Partitioning Layout

    Mark Hobley wrote:
    > Nico Kadel-Garcia wrote:
    >
    >> Never pull that stunt. Why? Because the 'pwd' command returns different
    >> information for your working directory if you are using /bin/pwd or the shell
    >> built-in pwd command, and $PWD not be the same thing as `/bin/pwd`. This way
    >> lies madness, because this command becomes environment sensitive.

    >
    > You are right that the GNU coreutils /bin/pwd returns /local/home,
    > whereas the shell pwd returns /home.
    >
    > I have never had a problem relating to this. What problems does this cause?
    >
    > Mark.
    >


    Oh, my. Many of them, over the years. It was particularly a problem with
    automounters that leave symlinks to their mount location, and it's very
    difficult to predict when it will explode something subtle. But it is
    particularly bad with scripts that do various 'cd $dir; cd ../otherdir' when
    the otherdir may simply not exist because the automounter didn't put it there
    in the target mounting directory, or in cases like the Oracle installers.

  18. Re: Linux Partitioning Layout


    Well, how about this one:
    I am planning this layout for PRODUCTION SERVER(Linux,Apache,
    PHP,MySQL) - about 4 websites with MySQL backend
    and around 10 websites with static content, so I am trying to optimize
    it for MySQL.

    Server has 16GB RAM.

    Based on your advice and some googling I have this layout so far.
    Please feel free to critize it( + explanation so we all can learn
    something)

    ================================================== =====
    Device | Mount Point | File System | Size |
    ================================================== =====
    "RAID 1"(hardware RAID) capacity 146GB (2 x 146GB Serial-Attach SCSI)

    /dev/sda1 /boot ext3 100 MB
    /swap swap 16 GB
    /dev/sda2 / ext3 40 GB
    /dev/sda3 /home ext3 40 GB


    on "RAID 10"(hardware RAID) capacity 146GB (4 x 73GB Serial-Attach
    SCSI)
    I create separate partitions for security(and protect from
    overflowing)
    and performance reasons.

    /tmp tmpfs 10 GB


    Primary partitions
    /dev/sdb1 /var ext3 20 GB
    /dev/sdb2 /var/lib/mysql ext3 60 GB
    /dev/sdb3 /var/log/mysql ext3 20 GB


    Extended partition
    /dev/sdb4 ext3 20 GB
    Logical partitions in sdb4:
    /dev/sdb5 /var/tmp ext3 10 GB
    /dev/sdb6 /var/spool ext3 10 GB


  19. Re: Linux Partitioning Layout

    Well, how about this one:
    I am planning this layout for PRODUCTION SERVER(Linux,Apache,
    PHP,MySQL) - about 4 websites with MySQL backend
    and around 10 websites with static content, so I am trying to optimize
    it for MySQL.

    Server has 16GB RAM.

    Based on your advice and some googling I have this layout so far.
    Please feel free to critize it( + explanation so we all can learn
    something)

    ================================================== =====
    Device | Mount Point | File System | Size |
    ================================================== =====
    "RAID 1"(hardware RAID) capacity 146GB (2 x 146GB Serial-Attach SCSI)

    /dev/sda1 /boot ext3 100 MB
    /swap swap 16 GB
    /dev/sda2 / ext3 40 GB
    /dev/sda3 /home ext3 40 GB


    on "RAID 10"(hardware RAID) capacity 146GB (4 x 73GB Serial-Attach
    SCSI)
    I create separate partitions for security(and protect from
    overflowing)
    and performance reasons.

    /tmp tmpfs 10 GB


    Primary partitions
    /dev/sdb1 /var ext3 20 GB
    /dev/sdb2 /var/lib/mysql ext3 60 GB
    /dev/sdb3 /var/log/mysql ext3 20 GB


    Extended partition
    /dev/sdb4 ext3 20 GB
    Logical partitions in sdb4:
    /dev/sdb5 /var/tmp ext3 6 GB
    /dev/sdb6 /var/spool ext3 6 GB
    /dev/sdb7 /var/mail ext3 6 GB

+ Reply to Thread