dection 5Storage Devices.docx

Du command 333 527 so the df command provides us with

Info icon This preview shows pages 44–45. Sign up to view the full content.

View Full Document Right Arrow Icon
du Command 3:33-5:27 So the df command provides us with a nice overview of how disk space is being consumed on the system, now there's another command that you need to be familiar with called the du command. du works a little differently. du will run through all the directories within a particular directory structureand tell you how much space is being consumed by the files in that directory. This command is especially useful when working with the /home directory because /home is where all of our users have their home directories, that's where they save all their files. Hence if you're going to run out of space on a Linux system, it'll probably be within /home. So you can see I have two user accounts on this system, I have ksanders and I have rtracy. If I want to see how much disk space each of this users is using, I can type du -h, again the -h parameter specifies that du reformat the output in human readable format. I'll press Enter and it runs through each of the directories in the ksanders home directory and the rtracy home directory. Now if we want to just get a high level summary of much space each user is consuming we can just look at the root directoryof each users home directory, in this case it's the ksanders directory for the ksanders user. She's only using about 3.9 megabytes so she's not using much space at all on the system. If we scroll up in the output and find the root directory for my rtracy user, you see that I'm using about 31 megabytes of disk space in my home directories which isn't very much so, we're good.Neither of these users over utilizing the storage space available on the disk. But if they were, you could then scroll through all of these different sub directories of the home directory and see whichdirectories are consuming the most space. You can look over here in this column to see how much space is being used in each of those directories and then if you found one that was being over utilized, that have downloaded hundreds of gigs of data then you might want to talk to them and say "Hey, could you clean up some of those files that you don't need actually need because you're using too much space." File System Check Command 5:28-7:58 Now the last command we want to look at in this demo is the file system check command, fsck. Now fsck is used to look for errors in the file system. Before we can run fsck though however we have to specify which file system it is that we want to check for errors. Let's go back to our df command and notice right here we have the /dev/sdb1 file system that is mounted in /mount/shared let's check the file system on this partition for errors. Now before we can do this we have to unmount this partition from the directory where it's mounted in the file system. So to do that I'm going to have to close this window over here otherwise it'll report that file system as being in use and it won't let me unmount it. You type umount and then enter the device file name for the partition that you want to unmount. Now a lot of folks who are new to Linux say "Hey, wait a minute you made a mistake you typed umount on unmount." and I said yep that's exactly right because the command is not
Image of page 44

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 45
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern