Partition Tables

Many computer users are familiar with the basic idea of filesystems. A storage device is divided into partitions each formatted to a particular filesystem that holds files. Well, just as the filesystem hold the files, a partition table holds the filesystems. There are a few partition table types. The most commonly known one is MBR.

Master Boot Record (MBR) – Most IBM-based PC storage units use this partition table format. MBR is often referred to as the msdos partition table. The MBR can only support storage devices up to two terabytes. MBR supports the concept of logical and primary partitions. A storage unit with the MBR table can only have up to four primary partitions. Many users wanting to make a multiboot system with more than four Linux distros often have the problem of not being able to support more partitions. Remember, logical partitions cannot be made bootable. Multiboot systems must use a different partition table discussed later.

GUID Partition Table (GPT) – Some IBM-based PC storage units have GPT, although it is usually because the user reformatted from MBR to GPT. However, most Intel-based Mac systems use GPT by default. The GPT partition table offers many improvements over MBR. GPT can support storage units up to over nine zettabytes. GPT is also the most highly recommended partition table for computers needing more than four operating systems on one hard-drive. For example, if a computer with a ten terabyte hard-disk is meant to be a multiboot system for seven different Linux distros, then GPT should be used. Most Unix and Unix-like operating systems can fully support GPT. However, most Windows systems cannot run on a GPT partition table. As for Mac systems, only the Intel-based ones can boot from GPT.

Apple Partition Map (APM) – The PowerPC-based Mac systems can only boot from APM partition tables. This is usually referred to as the Mac or Apple partition table. Linux and Intel-based Macs can use APM. Windows does not support APM.

Amiga rigid disk block (RDB) – Amiga systems use the RDB partition table. These partition tables support up to about 4*10^19TB. That is forty quintillion terabytes.

AIX – The AIX partition table is used by proprietary AIX systems. By default, Linux does not natively support the AIX partition table.

BSD – BSD Unix systems can use the BSD partition table. Linux and Windows cannot read BSD partition tables.

Others – Some other partition table formats are listed below. The below listed are very rarely used. Not much information can be seen on the Internet about them.

dvh
humax
pc98
sgi
sun

Removable Storage – You may be wondering, “Which partition table do flash drives, SD cards, etc. use?”. Well, since all systems can at least read MBR, the majority of mobile/removable storage uses MBR.

Formatting the partition table – To change or reformat a partition table, use Gparted and click “Device > Create Partition Table”. Then, choose the desired partition table. Alternately, Parted can be used to format a storage device with a particular partitioning table (also called a “disk-label”). Doing so will erase all partitions and data on the selected storage device. The command is “parted mklabel DISKLABEL”. The command requires Root privileges. The user will need to create new partitions for the storage device. Supported partitioning tables (supported by parted) include the listed below.
bsd
loop (raw disk access)
gpt
mac (Apple Partition Map (APM))
msdos (commonly called MBR)
pc98
sun

WARNING: Changing the partition table will erase the filesystems, partitions, and files. This is a more “low-level” format. However, the files are not truly gone. Read http://www.linux.org/threads/undelete-files-on-linux-systems.4316/ to fully understand the “deletion” of files.

You may also be wondering which is the best one for you. Well, use MBR with Windows and mobile systems (like Android), APM on PowerPC Macs and iOS, RDB on Amiga, and GPT on all other systems. However, you may have specific reasons for placing an OS on a different partition table than what is recommended one sentence previous.

Which Distro is Right for Me?

Debian Debian Linux will be well-suited for those who need stability. Debian Linux uses older software that is known to be stable. Generally, hospitals that use Linux will use Debian on important systems. Debian is usually a wise choice for a server system because the software is usually stable. The recommended system requirements are 1GHz processor, 512MB memory, 5GB hard-drive. http://www.debian.org/distrib/

Ubuntu For those that like Debian, but want the latest software and an interface with better graphics, Ubuntu is a common choice. Ubuntu is stable, but many Linux users recommend Debian for critical systems. The average mainstream desktop/laptop user will probably want Ubuntu. The recommended system requirements are 800MB memory, 1GHz processor, and 5GB hard-drive. http://www.ubuntu.com/download

Kubuntu Same as Ubuntu, but uses KDE. Users that dislike Unity may prefer Kubuntu. The recommended system requirements are 1GHz processor, 10GB hard-drive, and more than 1GB memory. http://www.kubuntu.org/getkubuntu

Xubuntu Xubuntu is a lightweight Ubuntu system for older hardware or hardware with less resources. Xubuntu uses the XFCE interface instead of Unity. The recommended system requirements are 512MB memory and 5GB hard-drive (tyr Lubuntu for something more lightweight). http://xubuntu.org/getxubuntu/
Linux Mint: For people that want a Debian-based system, but dislike Unity may be interested in Linux Mint. Linux Mint may come with the MATE, Cinnamon, XFCE, or KDE interface (user’s choice). The recommended system requirements are 1GHz processor, 1GB memory, and 10GB hard-drive. http://www.linuxmint.com/download.php

BackTrack (Kali) This is a Ubuntu-based high-security system. I would recommend this for Anonymous. BackTrack (now called Kali) is often used for hacking into other systems. Although, that is illegal unless you are hacking into a computer of your because you forgot the password. BackTrack/Kali is also used to evaluate security. Some companies may use BackTrack/Kali to find security flaws in their own system. http://www.kali.org/downloads/

Slackware Slackware is a simple lightweight system. Usually, Slackware is preferred among advanced users due to Slackware being less of a user-friendly system compared to other distros. The recommended system requirements are i486 processor, 256MB memory, and 5GB hard-drive. Advanced users wanting a lightweight system may prefer Slackware. http://www.slackware.com/

Arch Arch Linux is a minimalistic system that is supposedly very simple. It is also a lightweight system that is used among advanced Linux users. Advanced users that dislike Slackware may like Arch. https://www.archlinux.org/download/

Fedora Some Linux users may say Fedora is the RedHat counterpart of Ubuntu (Debian system). Fedora is perfect for many mainstream desktop/laptop users. Fedora handles graphics well and uses appealing interfaces. The recommended system requirements are 1GB memory and 10GB hard-drive. http://fedoraproject.org/en/get-fedora

Red Hat Enterprise Linux RedHat is usually used as a server system. Fedora is the client/desktop system while RedHat is the server “version”. So, if you would like to use Fedora as a server or need a system that is more stable than Fedora, then use RedHat.

Puppy Linux This is a very lightweight system that is usually used on older systems due to the light requirements. Puppy Linux may not have the best-looking interface, but it is still easy to use. The recommended system requirements are 333MHz processor, 64MB memory, 512MB swap, and 1GB hard-drive. http://puppylinux.org/main/Download Latest Release.htm

AnitaOS This is a form of Puppy Linux developed by @Darren Hale intended for old hardware. AnitaOS uses old kernels while the mainstream Puppy Linux uses the newer kernels. http://sourceforge.net/projects/anitaos/ | http://www.linux.org/threads/anitaos-a-diy-distro-you-build-it-yourself.4401/

Damn Small Linux (DSL) This is a lightweight Linux system that requires 8MB of memory and at least an i486 processor. People needing a lightweight system may want DSL if they dislike Puppy Linux. http://www.damnsmalllinux.org/download.html

CentOS CentOS is often comparable to Linux Mint, but CentOS is Red-Hat-based instead of Debian-based. In fact, CentOS is RHEL without the branding. Basically, if you want RHEL, but do not want to pay for it and support, then get CentOS. People who like Linux Mint, but want a Red-Hat system may be interested in CentOS. The recommended system requirements are 256MB memory and 256MB hard-drive. http://www.centos.org/modules/tinycontent/index.php?id=30

OpenSUSE OpenSUSE is a RedHat-based distro that has YaST and ZYpp. OpenSUSE is available as a rolling release or a stable version-by-version basis. The minimum requirements include 2GB memory, 5GB hard-space, AMD64 or Intel 2.4GHz. http://www.opensuse.org

If a distro containing no closed-source software anywhere in the system is needed, then check out GNU.org’s list of 100% open-source GNU/Linux operating systems – https://www.gnu.org/distros/free-distros.en.html

Updating Apache to the latest version on DirectAdmin

You can check the current version of apache by running
/usr/sbin/httpd -v

CustomBuild – current

If you’re using custombuild (as most new boxes are), run the following
cd /usr/local/directadmin/custombuild
./build update
./build apache
./build php n
./build rewrite_confs

CustomApache – end-of-life

If you are using customapache with the 1.3 version of apache to the most recent, run the following:
cd /usr/local/directadmin/customapache
./build clean
./build update
./build apache_mod_ssl

If you’re using apache 2.x, use “./build apache_2” isntead of apache_mod_ssl.
This should update both the configure options and the version of apache to the most recent version. Once the update has completed, you’ll need to restart apache:

RedHat:
/sbin/service httpd restart

FreeBSD:
/usr/local/etc/rc.d/httpd restart

Upgrading OpenSSH on CentOS

First, download the OpenSSH source tarball from the vendor and unpack it. You can find the tarballs at http://www.openssh.com/portable.html

cd /usr/src

wget http://mirror.team-cymru.org/pub/OpenBSD/OpenSSH/portable/openssh-6.8p1.tar.gz

tar -xvzf openssh-6.8p1.tar.gz

You may need to install a few things for the RPM build to work:

yum install rpm-build gcc make wget openssl-devel krb5-devel pam-devel libX11-devel xmkmf libXt-devel

Copy the spec file and tarball:

mkdir -p /root/rpmbuild/{SOURCES,SPECS}

cp ./openssh-6.8p1/contrib/redhat/openssh.spec /root/rpmbuild/SPECS/

cp openssh-6.8p1.tar.gz /root/rpmbuild/SOURCES/

Do a little magic:

cd /root/rpmbuild/SPECS
sed -i -e "s/%define no_gnome_askpass 0/%define no_gnome_askpass 1/g" /usr/src/redhat/SPECS/openssh.spec
sed -i -e "s/%define no_x11_askpass 0/%define no_x11_askpass 1/g" /usr/src/redhat/SPECS/openssh.spec
sed -i -e "s/BuildPreReq/BuildRequires/g" /usr/src/redhat/SPECS/openssh.spec

…and build your RPM:

rpmbuild -bb openssh.spec

Now if you go back into /root/rpmbuild/RPMS/<arch> , you should see three RPMs. Go ahead and install them:

rpm -Uvh *.rpm

To verify the installed version, just type ‘ssh -v localhost’ and you should see the banner come up, indicating the new version.

*IMPORTANT! You may want to open a new SSH session to your server before exiting, to make sure everything is working! If you have a problem, simply:

yum downgrade openssh-server

Linux and UNIX view command-line history

BASH is the default shell for Linux computers. Bash has history command. It display the history list with line numbers i.e. it lists everything you have entered on the command line. You can recall commands from history so that you can save the time.

Task: View your command Line History

Type the following command:

$ history

Output:

911 man 7 signal
912 man ps
913 man 7 signal
914 man killall
915 killall -l
916 man killall
917 su –
918 su – lighttpd
919 su – lighttpd
920 cd /tmp/

So whenever you type a command, that command is saved is a file called .bash_history. Type following commands to get more info:

$ help history

$ man bash (look for Event Designators for more info).