`
If you find these tutorials useful, Please consider making a donation.

TheFrugalComputerLinuxLogo.png
TheFrugalComputerGuy.png
Linux Command Line 19
Disks







Linux Command Line (78) df

df is short for Disk File systems and will show the amount of disk space available for all the disk file systems mounted on the computer. Adding a file system or file systems to to df command will only show disk space information about the file systems added to the command. Disk space and be calculated in base 10 or base 2. The df command can also show information about inodes for the disk file systems.





 






Linux Command Line (79) du

The du command is used to show directory and file size usage. Typing du by itself will show all the directories and sub-directories of the directory you are in. Adding the -a option will also show all the files as well as directories. The du command will show how much disk space a file is using, often the file size is less than the amount of disk space used. We end the video with a look at ncdu.





 






Linux Command Line (80) Linux File System pt1

In this video we start a look at the Linux directory structure. We will look at the difference between the /bin directory and the /sbin directory and what goes in the /lib directory(ies). We also look at the /ect, /home, and /usr directories as we as a few other system directories..





 






Linux Command Line (81) Linux File System pt2

In this video we complete our look at the Linux directory structure. We talk about at the /mnt and /srv directories and suggest when to use one over the other. We talk about the /media and /opt directories and take a look at the /proc directory as well as other system directories..





 






Linux Command Line (82) Mount a USB drive

We first look at what happens when we insert a USB drive into a Linux Mint operating system, then we manually unmount it.

We then create a new partition to manually mount that USB drive and mount the USB drive, but we cannot write to the USB drive.

We unmount the drive again and then mount it giving our user ID read/write permissions.

The last thing we do is we unmount the drive and remount it giving our user ID read/write permissions and our user group and other read only permissions.





 






Linux Command Line (83) Mount a USB drive at startup

To mount the correct hard drive at startup, we first look at how to identify the correct hard drive by using the UUID (Universally Unique Identifier).

We are going to update the /etc/fstab file to mount the USB drive on startup.

We find the UUID with the command:
ls -l /dev/disk/by-uuid

We will also need to know the file type, we find that with the command:
df -T /dev/sdc1

We then make a backup of the /etc/fstab file before making any changes to it.

We end the video looking at the different fields needed for to create an fstab record, then we create an /etc/fstab record to mount a USB drive on startup.





 






Linux Command Line (84) Partition a USB drive (GUI)

We look at removing, adding, and resizing partitions on a USB drive. In this video, the partition removing, adding, and resizing is all done in a GUI environment to help visualize what is being done with the partitions. In the Next video, we will do the same thing (remove, add, and resize partitions) in the command line environment.

In this video, we also take a look at the partition file system types and why you might choose one file system type over another.





 






Linux Command Line (85) Partition a USB drive using CLI

We look at removing, adding, and resizing partitions on a USB drive using CLI ((The Command Line Interface)). In the previous video, we did the same thing (remove, add, and resize partitions) in a GUI environment.





 






Linux Command Line (86) mklabel mktable

We look at the parted command mklabel/mktable specifically for the msdos/mbr gpt disk partition tables.

We start off just looking at the difference between the partitions, but after that we go into a little more depth about each and boot systems they work with.

msdos/MBR works with BIOS/(Legacy Boot) and gpt works with UEFI

Then we reformat the USB drive from msdos to gpt, and create a FAT32 partition to take all the disk space on that USB drive.





 






Linux Command Line (87) Partition Label

We add partition labels to partitions on a USB disk. We saw that different filesystems use different label commands.

For example, We used "sudo fatlabel /dev/sdb1 PART1_FAT16" to rename our FAT16 filesystem and we used "sudo e2label /dev/sdb2 PART2_EXT4" to update an EXT4 filesystem partition.

The commands shown in the video are not the only ways to update a partition label, for example to update the EXT4 partition, we could also have used the command "sudo tune2fs /dev/sdb2 PART2_EXT4" which was not shown in the video.





 






Linux Command Line (88) fdisk

We first look at how fdisk can list out what drives are on that computer, then we go into fdisk command mode for a single drive and delete partitions and change the disk label from dos to gpt. We write out those changes, then we go back in to fdisk command mode and create partitions on the new gpt disk partition table.





 






Linux Command Line (89) dd pt1

We look at the dd command and how it can be used to copy files or selected parts of files. We also look at how the dd command can be used to stress a single CPU and how it can be used to make files of a specific size.





 






Linux Command Line (90) dd pt2

We use the dd command to copy a USB drive to another USB drive of the same size. Then we copy a USB drive to a USB drive that is larger and use gparted to expand the space to use all the space on the larger drive.

We then use the dd command to make a gzip backup of a USB drive and restore from the gzip file to another USB drive.