Managing Disks in Linux

Linux Commands

With having Linux installed we need to start to understand some of the basics of how to use Linux. Linux has a graphic user interface (GUI), but a lot of the work that is done in Linux is on the command line interface (CLI). During this course we will learn a lot of various CLI commands.  The first set of commands will help us understand how to create partitions, managing disks and restart our Linux system.

Make sure to watch the videos and visit each hyperlink to gain a better understanding of each command.

dmesg

dmesg - this command provides us the ability to view kernel related information. 

This is an important command to understand and use as it provides us with information about Linux starting up (just one use of this command).

https://linux.die.net/man/8/dmesg

runlevel & init & shutdown

Linux has various run levels the tell the system how to start up, shut down or even reboot. 

This is an important command as we need to understand how to maintain our Linux systems status (on/off/rebooting)

Explanation of runlevels 

https://linux.die.net/man/8/runlevel 

https://linux.die.net/man/8/init 

Check Runlevel

https://linux.die.net/man/8/shutdown

fdisk

fdisk has many uses. It can list your partition table and create partitions on a drive. This video also shows you how to format a partition with a filesystem using mkfs.

https://linux.die.net/man/8/fdisk

https://linux.die.net/man/8/mkfs

cfdisk

cfdisk is like fdisk (allows ability to create partitions). Though, I personally like cfdisk better due to the easier user interface. 


https://linux.die.net/man/8/cfdisk

swapon & swapoff

Swap space is used with our physical memory. If we need to load an application into memory, but our computer does not have enough we can swap out items to the hard drive to free up space. This is why we have a swap partition, it helps our systems performance.  Most of the time we do not need to use these commands as when Linux starts up the swap partition is turned on. These are just good commands to know just in case.

https://linux.die.net/man/8/swapon 

https://linux.die.net/man/8/swapoff 

https://linux.die.net/man/8/mkswap

df

The df command is used to look at disk usage. It can show you the size of a partition and how much space is available. This is a command that you'll use frequently. 

https://linux.die.net/man/1/df

du

The du command is used to look at the size of a file or directory. This is another command that you'll use frequently. 


https://linux.die.net/man/1/du

mount & umount

The mount command is used when you want to make Linux aware of a partition and add it to the filesystem for use. The umount command remove a partition for the Linux filesystem.  These commands are used frequently with USB drives, though recently a lot of Linux systems are auto mounting these devices, but these are still very important command to be able to use and understand.

https://linux.die.net/man/8/mount 

https://linux.die.net/man/8/umount