Howtos / Articles

List all hard disks connected to a CentOS system

You often need to know what physical drives are attached to a system, how many drives are connected, or even what device names match up with which physical drive. There is a handy tool called ‘lshw’ which is used to extract detailed information on the hardware in the PC. Unfortunately this doesn’t come pre-installed on CentOS. The details below will go through installing lshw, and how to run it to list all the hard drives. Prerequisites This guide requires the…

Read more [...]

List all hard disks connected to a Ubuntu system

You often need to know what physical drives are attached to a system, how many drives are connected, or even what device names match up with which physical drive. Ubuntu comes with a handy tool called ‘lshw’ which is used to extract detailed information on the hardware in the PC. To view a listing of all disks in the system: $ sudo lshw -class disk -short This will list all disks and storage devices. This includes DVD drives, USB card…

Read more [...]

Save iptables firewall config on CentOS 6

Changes you make to iptables firewall rules only exist for the current boot, and if you don’t save the config, you will loose any changes upon rebooting. CentOS 6 blocks most incoming ports by default, so you will generally have to make changes to the firewall if you install any new packages. Thankfully CentOS 6 provides the ability to easily save the configuration. To save the current iptables firewall config, issue the following command: # service iptables save Example output:…

Read more [...]

Find what Linux distribution you are using

There are many Linux distributions out there, all with their slight differences. It’s sometimes its hard to determine what distribution you are current using, assuming you weren’t the one who installed it. The commands below can be used to determine the Linux distribution you are using, and in most cases, what version. Generic check: cat /etc/issue.net or cat /etc/issue Sample output: # cat /etc/issue.net CentOS release 6.3 (Final) Kernel \r on an \m # This shows that the distribution is…

Read more [...]

Find what Linux kernel version you are running

To determine what version of the Linux kernel you are currently using, you can use the uname command as per the examples below. $ uname -a This will output the host name of the computer, Kernel version, and the CPU architecture. Example output: $ uname -a Linux localhost.localdomain 2.6.32-279.19.1.el6.x86_64 #1 SMP Wed Dec 19 07:05:20 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux $ localhost.localdomain being the host name of the computer 2.6.32 being the kernel version (the rest relates specifically to…

Read more [...]