Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
International Rescue Committe

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents
Up to --> System Monitoring

· Finding Out About Your System
· Hardware and the Kernel
· Terminals
· Hard Disks and File Systems
· User Files
· Network Files
· Important System Files

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Recommend Us
Surveys

Features
HOWTOs
News
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 191 guest(s) and 1 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  
Linux Tutorial - System Monitoring - Finding Out About Your System - Hard Disks and File Systems
  Terminals ---- User Files  


Hard Disks and Filesystems

A common problem that has caused long calls to support is the layout of the hard disk. Many administrators are not even aware of the number of partitions and file systems they have. This is not always their fault, though, because they often inherit the system without any information on how it's configured.

The first aspect is the geometry, which includes such information as the cylinders, heads, and sectors per track. In most cases, the geometry of the hard disk is reported to you on the hardware screen when the system boots. You can also get this information from fdisk.

To find how your hard disk (or hard disks) is laid out, there are several useful programs. The first is fdisk, which is normally used to partition the disk. Using the -l option, you can get fdisk to print out just the partition table. On my system, I get output like this:

Disk /dev/sda: 255 heads, 63 sectors, 1106 cylinders Units = cylinders of 16065 * 512 bytes Device Boot Start End Blocks Id System /dev/sda1 1 653 5245191 83 Linux /dev/sda2 654 1106 3638722+ 83 Linux Disk /dev/hda: 255 heads, 63 sectors, 826 cylinders Units = cylinders of 16065 * 512 bytes Device Boot Start End Blocks Id System /dev/hda1 1 192 1542208+ c Win95 FAT32 (LBA) /dev/hda2 * 193 199 56227+ 83 Linux /dev/hda3 200 250 409657+ 82 Linux swap /dev/hda4 251 826 4626720 83 Linux Disk /dev/hdc: 16 heads, 63 sectors, 39770 cylinders Units = cylinders of 1008 * 512 bytes Device Boot Start End Blocks Id System /dev/hdc1 1 8739 4404424+ 83 Linux /dev/hdc2 8740 17478 4404456 83 Linux /dev/hdc3 17479 27881 5243112 83 Linux /dev/hdc4 27882 39770 5992056 83 Linux

One my system I currently have three hard disks. The first one listed is a SCSI disks (/dev/sda) although this is not the first one booted. The second and third are both EIDE drives (/dev/hda, /dev/hdc). The first EIDE is what I boot from, and as you can see fdisk says there is a Windows 95 partition (although Windows 98 is actually installed). Followed by a small Linux partition (50 MB), the Linux swap space and another Linux partition. All of the other partitions on all drives are Linux.

If you look carefully and compare the ending blocks with the starting blocks of the next physical partition, you see that, in this case, there are no gaps. Small gaps (just a few tracks) are nothing to have a heart attack over because you are only loosing a couple of kilobytes. However, larger gaps indicate that the whole hard disk was not partitioned, and you may be loosing some useful space.

If you have multiple hard disks on your system, your messages file (i.e., /var/log/messages) may show you this. Every version of Linux I have seen will report all the SCSI devices it sees, and because hard disks are all standard devices, they should all be reported.

If you have multiple hard disks, you can specify the devices as an argument to fdisk. For example, to print the partition table for the second SCSI hard disk, the commands would be

Unlike other dialects of UNIX, Linux cannot have multiple file systems in each partition. Therefore, you cannot have more file systems than you have partitions. (I'll ignore NFS, etc., for the time being.) However, here we are talking about both primary and logical partitions. In my case, all of my partitions are primary, which limits me to only four partitions per drive. However, if I created an extended partition, I could have many more logical partitions(I have created 8 logical partitions for testing and have been told you can have more). Theoretically, each partition (whether primary or logical) can have a different Linux distribution version.

To find out what file systems are on your disks, first use the mount command. However, this command only tells you which file systems are currently mounted. Using this command on a running system is useful to determine whether a directory is part of one filesystem or another. Although the df command (more on that later) will tell you which file systems are mounted, it doesn't tell you what options were used, such as whether the file system is read-only. On a few occasions, I have had customers call in reporting file systems problems because they could write to them, but found out they were mounted as read-only.

What if you suspect that there are more file systems than are mounted? The first thing to do is check fdisk for all the hard disks on your system. If you have only one hard disk and it only has one partition, then only one file system can be mounted.

Maybe the file systems exist but aren't mounted. To check, first run the mount command to see what is currently mounted. Then check the /etc/fstab file to see what file systems are known and what the options are. A noauto in the options column means that file system should not be mounted automatically when the system boots. Therefore, it's possible that a filesystem was created on a partition, but it is not mounted automatically when the system boots.

 Previous Page
Terminals
  Back to Top
Table of Contents
Next Page 
User Files


MoreInfo

Test Your Knowledge

User Comments:


You can only add comments if you are logged in.

Copyright 2002-2009 by James Mohr. Licensed under modified GNU Free Documentation License (Portions of this material originally published by Prentice Hall, Pearson Education, Inc). See here for details. All rights reserved.
  
Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.


Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
You can get all the latest Site and Linux news by checking out our news page.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.11 Seconds