Softpanorama

May the source be with you, but remember the KISS principle ;-)
Contents Bulletin Scripting in shell and Perl Network troubleshooting History Humor

Hard Drive Partitioning

News

Linux Installation

Recommended Links SLES Installation Checklist SLES Registration SuSE install from USB drive Installing Suse from ISO image
PXE installation iLO 3 -- HP engineering fiasco Dell DRAC installing Qlogic QLE2460 cards Linux Multipath autoyast YaST
Siga SupportConfig Support Assistant Installation of Oracle 11g Linux Software RAID Humor Etc
  1. We assume that the system has four 146 GB drives, that are configured into two logical drives using mirroring.
  2. Always use Ext 3 filesystem for all partitions, do not use Reisner which is a dead project (Ext3 is still not a  default of Suse 11 SP 1)
  3. Mark all partitions except swap with format option (unless this is a re-install)
  4. Unless you know LVM really well never put your root partition on LVM. It complicates recovery. If the system is unbootable then after booting from a recovery disk you will find out that you LVM disks are not visible. For many sysadmin at this point cold goes down the spine.
  5. Swap file is a special Linux filesystem used by virtual memory management. If you have sufficient memory this file is never used, so it make sense to put it at the beginning of the drive (along with the /home partition -- another little used partition in Unix) to workhorse partitions such as root (that can include /usr and opt), /tmp and /var  closer to the middle of the drive.
  6. Unless you want to have /usr as read-only partition, in Suse it is not needed (nor makes much sense) to create separate partitions for /usr and /opt. They can be merged with root partition. That makes usage of disk space more efficient.  

    primary partitions:

    1. /boot
    2. swap. Swap should generally be allocated as the second partition on disk after /boot as it mostly unused. For small amount of RAM (less then 8GB) swap should be approximately 2x ram-size. For large amount of RAM swap can he half of RAM. For example in case of workstation with just 2GB  you need  4GB for swap.
    3. /home. Typically this is a little used partition that should approximately 8-16 GB just for private files of sysadmin and users.  In case you run out of space it can already be converted into LVM volume

    Extended partitions

    1. root (think twice before putting root partition under LVM). Can include /opt and /usr. Total can be 16GB or something like that for everything.
    2. LVM partitions
      1. /var   For a typical serve should be around 20-30GB. This partition contains logs so it you have a web server or other large logs producing program it should be big.
      2. /tmp. Should probably be 6-12 GB
      3. /srv
  7. With Suse 11 SP 1 you probably should always use LVM at least for /var  /home and /srv as size requirements for those partitions can change: it looks like there is no difference in stability and LVM provides additional flexibility and ability to create snapshots.
  8. If you use SAN for data and local harddrives just for storing OS using LVM does not make much sense as SAN provides necessary flexibility in resizing partitions. 

To optimize disk configuration put swap and home partitions before root partition. This way root partition will be closer to the middle of the disk.


Top Visited
Switchboard
Latest
Past week
Past month

Old News ;-)

Cool Solutions Install Linux Frequently, Without the Hassle

With RPM-based Linux distributions, version-to-version upgrades often don't work very well.  A fresh installation may be the better choice.  One may be reluctant to do this, because of the potential loss of data, preferences, configuration, and third-party applications.  Also, if you don't like the newly installed system, the thought of reinstalling the old system to switch back to it is not a pleasant thought either.

This document describes a means of reinstalling Linux frequently, while minimizing the effort needed to become productive on a new system.  It also allows you to instantly and effortlessly rollback to a previous Linux OS if you aren't happy with a newly installed system.  Some possible applications of these suggestions include trying a new Linux distribution, or staying up-to-date with the latest beta release of your favorite Linux distribution.

Table of Contents

1. Introduction
1.1. Assumptions
2. Partitioning
2.1. Swap
2.2. Root Partitions
2.3. Data Partition
2.4. Variations
2.5. Partition Table Summary
3. Installing The First Instance of Linux
3.1. Install Target
3.2. Bootloader Location
3.3. Mount the Data Partition
4. Fixing the Bootloader
4.1. Move Bootloader Files
4.2. Install GRUB in the Boot Sector of the Root Partition
4.3. Edit the Boot Menu
4.4. Booting the Linux OS
5. Home Directory Maintenance
5.1. Setup the Data Partition
5.2. Symlinking to the Data Partition
5.3. Using the Customized Home Directory
6. Installing More Linux Systems
6.1. Bootloader Location
6.2. Mounting the Data Partition
6.3. Creating the Symbolic Links
7. Practical Use
7.1. Beta Snapshots
8. Other Hints
 
8.1. Third-party Applications
8.2. Make the Most of Symbolic Links
9. Summary

1. Introduction

If a little extra care is taken when first installing Linux on a system, it can require far less maintenance over the lifetime of the system. This document presents suggestions for using partitions and symbolic links to your advantage to minimize the effort required to test-drive a new Linux distribution.

1.1. Assumptions

The rest of this document makes the following assumptions:

  • The system has a single hard disk: /dev/hda
  • Windows is installed on /dev/hda1
  • Your hard disk is sufficiently large, relative to your needs, that you can leave at least one 5 to 10 GB partition unused at any given time
  • You know how to install Linux, including repartitioning
  • If your system differs from this, you'll need to make appropriate adjustments to the examples that follow.  For example, if you do not have windows installed, the swap partition can be /dev/hda1 instead of /dev/hda2.  If you actually think you can find a use for the entirety of your modern, huge hard disk, this document is not for you.
     

    2. Partitioning

    2.1. Swap

    Use /dev/hda2 for the Linux swap partition.  It is usually recommended to have a swap partition 2x the size of physical RAM.  So, if you have 1GB RAM, make a 2GB swap partition.

    2.2. Root Partitions

    You'll want at least two root partitions so you can install a new version of the distribution, a different distribution, or a new build (or example, the next beta) without losing the Linux system you currently use.  This way you can always instantly rollback to the previous system without loosing any data.  Depending on the size of your hard disk, you'll probably want to make these partitions 5 to 10 GB each. 

    2.3. Data Partition

    Create one more Linux partition consuming the remainder of the hard disk.  This is where data will be stored so that it will not be lost when the OS is reinstalled onto one or the root partitions, and so that multiple systems can share the same data.

    2.4. Variations

    You can have other partitions if you like.  Perhaps you want to have a separate partition for VMWare images.  This isn't really necessary though since everything can be lumped under the Data partition, and symbolic links can be used if you want things to appear to be somewhere else.  If you want to share data between Linux and Windows, you may need an extra FAT32 partition.  Linux can read from NTFS volumes, but not write to them (last time the author checked).  By having an extra FAT32 partition (drive D: on Windows), you can put data on this partition and access it from either Windows or Linux. 


    Normaly i use a swap partition of twice the size of the ram memory.

    Creating dynamic swap space

    Posted by Steve on Thu 27 Sep 2007 at 06:32

    Tags: , ,

    When a GNU/Linux machine runs out of physical memory it will start to use any configured swap-space. This is usually a sign of trouble as swap files and partitions are significantly slower to access than physical memory, however having some swap is generally better than having none at all. The size of swap allocated to files, or partitions, is usually chosen arbitrarily with many people adopting the "double the memory size" rule of thumb. Using a dynamic system can ease the maintainance of this size.

    The relatively unknown dphys-swapfile package contains a simple script which will create and activate a swapfile at boottime which is sized appropriately for your system.

    The advantage of this dynamic creation is that the swap will be resized automatically if you upgrade your memory and don't remember to do it.

    Upon recent kernels there doesn't appear to be a significant penalty to using swap files as opposed to swap partitions. With this in mind I'd recommend files rather than partitions, to give yourself more flexibility.

    To get started first remove any existing swap you have allocated. You can view any swap space which is in use by running:

    skx@vain:~$ /sbin/swapon  -s
    Filename                                Type            Size    Used    Priority
    /dev/md1                                partition       2931768 557428  -1
    

    Here we see that there is swap allocated to the physical raid volume /dev/md1. We can disable that by running:

    root@vain:~# /sbin/swapoff /dev/md1
    

    Once it is gone we can now install the package upon installation the system will create and activate then new swap:

    root@vain:~# apt-get install dphys-swapfile
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following NEW packages will be installed
      dphys-swapfile
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 9572B of archives.
    After unpacking 111kB of additional disk space will be used.
    Get: 1 http://apt-cache sid/main dphys-swapfile 20061020-1 [9572B]
    Fetched 9572B in 0s (60.5kB/s)       
    Selecting previously deselected package dphys-swapfile.
    (Reading database ... 116206 files and directories currently installed.)
    Unpacking dphys-swapfile (from .../dphys-swapfile_20061020-1_all.deb) ...
    Setting up dphys-swapfile (20061020-1) ...
    Starting dphys-swapfile swapfile setup ...
    computing size, want /var/swap=1876MByte, generating swapfile ... of 1876MBytes
    done.
    

    Now whenever you boot you'll have /var/swap created at a size of twice your amount of physical memory, automatically.

    You can verify this yourself with the swapon command we demonstrated earlier:

    skx@vain:~$ /sbin/swapon  -s
    Filename                                Type            Size    Used    Priority
    /var/swap                               file            1921016 0       -3
    

    If you wish to change the location, or size, of the generated swapfile please create the file /etc/dphys-swapfile and give it contents such as this:

    # /etc/dphys-swapfile - user settings for dphys-swapfile package
    # author Neil Franklin, last modification 2006.09.15
    # copyright ETH Zuerich Physics Departement
    #   use under either modified/non-advertising BSD or GPL license
    # this file is sourced with . so full normal sh syntax applies
    
    # where we want the swapfile to be, this is the default
    CONF_SWAPFILE=/swap.file
    
    # size we want to force it to be, default (empty) gives 2*RAM
    CONF_SWAPSIZE=2048
    
    ##
    #  Give yourself three times the memory size of swap?
    #
    # mem=$(grep MemTotal /proc/meminfo |awk '{print $2}')
    # CONF_SWAPSIZE=$(expr $mem \* 3)
    #
    


    Etc

    FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available in our efforts to advance understanding of environmental, political, human rights, economic, democracy, scientific, and social justice issues, etc. We believe this constitutes a 'fair use' of any such copyrighted material as provided for in section 107 of the US Copyright Law. In accordance with Title 17 U.S.C. Section 107, the material on this site is distributed without profit exclusivly for research and educational purposes.   If you wish to use copyrighted material from this site for purposes of your own that go beyond 'fair use', you must obtain permission from the copyright owner. 

    ABUSE: IPs or network segments from which we detect a stream of probes might be blocked for no less then 90 days. Multiple types of probes increase this period.  

    Society

    Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

    Quotes

    War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

    Bulletin:

    Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

    History:

    Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

    Classic books:

    The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Haterís Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

    Most popular humor pages:

    Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

    The Last but not Least


    Copyright © 1996-2016 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License.

    The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

    Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

    FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

    This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

    You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info

    Disclaimer:

    The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

    Last modified: September, 06, 2012