Answers to: What are the default partition names in Linux?http://linuxexchange.org/questions/589/what-are-the-default-partition-names-in-linux<p>What are the default partition names when installing Linux? Is it the same for Ubuntu?</p>enMon, 24 May 2010 20:26:02 -0400Answer by Anthony Stantonhttp://linuxexchange.org/questions/589/what-are-the-default-partition-names-in-linux/693<p>@madpuppy:</p> <p>You gave an incorrect answer.</p> <p>Those aren't partitions and the guy who answered the question before you already made that clear.</p> <p>swap doesn't have to be a partition either. It can be a swap file in its own directory too. A lot of linux distributions are doing that now so you don't have to make a special partition for swap memory.</p> <p>You're answer is wroing.</p>Anthony StantonMon, 24 May 2010 20:26:02 -0400http://linuxexchange.org/questions/589/what-are-the-default-partition-names-in-linux/693Answer by madpuppyhttp://linuxexchange.org/questions/589/what-are-the-default-partition-names-in-linux/601<p>this is my super simple answer</p> <p>By default, most distributions will have 3 partitions, root or / "swap" and "Home"</p> <p>some are even more simple but not recommended. Ubuntu used to just create a root partition and a "swap" partition when you went with automatic install erase entire disk. I am not sure if they changed that "not-good" practice. The problem with not creating a home partition is that there is a very high chance that you will loose all your personal files and settings if something happens to the root partition or if you are installing or upgrading to a newer version of your distro.</p>madpuppySat, 15 May 2010 04:09:06 -0400http://linuxexchange.org/questions/589/what-are-the-default-partition-names-in-linux/601Answer by tallshiphttp://linuxexchange.org/questions/589/what-are-the-default-partition-names-in-linux/597<h2>Partitioning Schemas - The basics</h2> <hr> <p>The partition schemata is basically the same no matter what Linux Distro you install. After all, it is Linux, NOT the distro, that determines the naming scheme.</p> <p>for years, the basic schemata was twofold, sort of, depending upon whether you had <strong>IDE</strong> (which includes <strong>MFM</strong> or <strong>RLL</strong> drives) or <strong>SCSI</strong>.</p> <p>Nowadays, there is a more, extended naming schema, considering newer hard drive types and buses, or variations of <strong>LVM</strong>, but I'll cover the original two, which will carry you onward into the others simply by understanding these:</p> <p>1.) First, the hard drive types were named for IDE HDDs (hd), or SCSI HDDs (sd). From root, since everything is addressed via the filesystem, these block devices were accessable from <strong>/dev</strong>.</p> <p>Therefore, and considering that there are two devices addressable on each IDE bus, your primary master would typically be listed as:</p> <blockquote> /dev/hda </blockquote> <p>The 'third' IDE HDD in your system (which would correlate to Drive zero on Bus 1) would be addressed as the following:</p> <blockquote> /dev/hdc </blockquote> <p>The third SCSI HDD on your first controller (SCSI controller 0), assuming you're not accessing it by LUN (as in the case of a CDROM or Tape Drive tower), would typically be addressed as:</p> <blockquote> /dev/sdc </blockquote> <p>2.) Partitions. Each Hard Drive can have multiple partitions, and each HDD does in fact have at least one, if there is any data present, on that formatted hard drive.</p> <p>partitions are numbered <em>ordinally</em> with <em>counting numbers</em>, instead of <em>whole numbers</em> (the difference being that as far as integers go, whole numbers start with zero, and counting numbers start with 1).</p> <p>So the first partition on any hard drive would be numbered <em>1</em>, the second partition <em>2</em>, and so forth...</p> <p>Therefore, your primary boot partition would 'typically' be the first IDE drive, connected via a 40 pin ribbon cable to the first IDE bus's header connector on the motherboard (according to the BIOS, this would be Controller 0, Drive 0, - the <em>primary master</em>).</p> <p>if you mounted <strong>/</strong> on the second partition of this primary IDE HDD, and <strong>/stuff</strong> on the second partition of the second SCSI drive on your system, and <strong>/home</strong> on the only partition of your first SCSI drive in your system, then your <strong><em>/etc/fstab</em></strong> might look like this:</p> <blockquote> <pre><code>/dev/hda1 /boot ext2 defaults 1 2 /dev/hda2 / xfs defaults 1 1 /dev/sda1 /home ext4 defaults 1 2 /dev/sdb2 /stuff xfs defaults 1 2 /dev/sdb1 swap swap defaults 0 0 /dev/hdc /cdrom auto noauto,owner,ro 0 0 /dev/fd0 /floppy auto noauto,owner 0 0 proc /proc proc defaults 0 0 devpts /dev/pts devpts gid=5,mode=620 0 0 tmpfs /dev/shm tmpfs defaults 0 0 usbfs /proc/bus/usb usbfs devgid=10,devmode=0660 0 0 </code></pre> </blockquote> <p>The <strong><em>/etc/fstab</em></strong> is your <strong>'file system table'</strong>, which indicates what is mounted where (more specifically, which directories are mounted on what devices and partitions), and is <em>space delimited</em>. the third field in the file indicates the type of file system you have prepared on this partition, and in the example above it shows an extended 2 file system for your /boot, and extended 4 file system for your /home, a swap partition and a couple of SGI XFS file systems too.</p> <p>As you can probably already extrapolate, the floppy drive is device <strong>/dev/fd0</strong> and it is mounted as <strong>/floppy</strong>, while the cdrom drive is the primary drive located on the second IDE bus at <strong>/dev/hdc</strong> (<strong>PATA</strong> is more correct than <strong>IDE</strong>, but nobody says that. Nevertheless, the correct terminology is <strong>PATA</strong> and <strong>SATA</strong> and <strong>SCSI</strong>). </p> <p>The fourth field above, can simply be '<em>defaults</em>', or might have a comma delimited set of mounting options such as '<em>noauto,owner,ro</em>' for devices like CDROMS - which are '<em>ro</em>', or Read Only, and even have devmodes such as default masks and group ids such as '<em>devgid=10,devmode=0660</em>', in our example.</p> <p>The last two fields, concern dumps and the order in which filesystems are to be checked at boot time, if they are present.</p> <p>Getting back to what I mentioned above in defining what /etc/fstab is, I think that as a point of extremely important clarification, I should emphasize that there is an <em>enormous</em> difference between <strong>partitions</strong> and <strong>directories</strong>.</p> <p>Partitions are the physical and logical demarcations separating regions of your disk, while directories are simply the logical hierarchy of how your filesystem is laid out.</p> <h2>Directories are NOT Partitions - And Don't Confuse the Difference!</h2> <hr> <p>The following are <strong>NOT</strong> partitions, and to confuse them with such is a <strong>huge</strong> mistake:</p> <blockquote> <pre><code>/ /boot /root /home /var /dev /opt /usr /etc /opt /usr/local /stuff </code></pre> </blockquote> <p>As you can clearly see in the <em>/etc/fstab</em> example above, various disks on our example system have been partitioned and certain directories have been mounted on those partitions.</p> <p>Logically, everything stems from <strong>/</strong> (root), but often, people like to mount directory subtrees beginning with <strong>/usr</strong>, <strong>/var</strong>, <strong>/home</strong>, and others on separate partitions to facilitate certain systems administration functions like, being able to replace an operating system without destroying all user data in the <strong>/home</strong> directory tree, or mounting <strong>/var/log</strong> on it's own partition or completely separate logging server, for example.</p> <p>Be careful not to mix apples and oranges. Again, <strong>Directories and partitions are two completely different concepts</strong> - fruits that are produced from different trees.</p> <h2>Mounting Remote Resources in fstab</h2> <hr> <p>A couple of other rather important schema for mounting directories relates to <strong>NFS</strong> and <strong>UNC</strong>, which would show up in an <em>/etc/fstab</em> entry such as: </p> <blockquote> <pre><code>box.sld.tld:/exported_filesystem_on_box </code></pre> </blockquote> <p>and...</p> <blockquote> <pre><code>//winbox:/c </code></pre> </blockquote> <p>The first example above shows the first fstab entry for an nfs mount on a remote host named 'box' (by its FQDN), and the second example shows how you would mount a resource via, for example, a NetBIOS UNC (which you would normally think of as <code>\\winbox\c$</code>)</p> <p>Obviously, the actual <strong>partitions</strong> that these two mount points exist on are physically on other machines, so do view that partition data, you would need to examine <strong>fdisk</strong> or a similar tool locally on either <em>box</em>, or <em>winbox</em>, respectively.</p> <h2>And the Monkey Wrench - libata</h2> <hr> <p>Now that we've covered the standard. I have to throw in a little snafu that is sometimes present with some distros (and even this is different from version to version, sometimes being used in one version of a distro and then perhaps even being discarded in a later version), and that is the subject of <strong>libata</strong>, which has been available since kernel 2.6.20.</p> <p>You should note, that the use of <strong>libata</strong> doesn't change anything that I've stated above, it simply changes how you are going to view and access these devices if <strong>libata</strong> is used on your particular version of the distro that you've installed (um..., booted into, rather). And it does tend to confuse, or at least obfuscate an elegant and simple schema, IMNSHO.</p> <p>If you're distro defaults to using <strong>libata</strong> then most everything is going to be listed as <strong><em>/dev/sdXY</em></strong>, where <strong><em>X</em></strong> = the ordinal device number and is represented as an alphabetic character, and <strong><em>Y</em></strong> = the ordinal partition number represented as a counting number (integer that is >= 1).</p> <p>This can cause some confusion, however, when, for example, you have a device such as <em>/dev/sdb</em> - is that the second SCSI device? The second SATA or IDE HDD?</p> <p>Finally, under the <em>libata</em> naming schema, CDROM/DVD devices are going to be referred to as <strong><em>/dev/srX</em></strong>, where <strong><em>X</em></strong> = the ordinal device number and is represented as an alphabetic character.</p> <p>This too is confusing, and IMO, only serves to obfuscate what kind of device is actually present, since you no longer can tell from just running the mount command or cat'ing <em>/etc/fstab</em> whether your DVD drive is an <strong>IDE</strong> (<strong>PATA</strong>) device, or a <strong>SCSI</strong> device.</p> <p>For a bit more reading on the subject, you can consult the man pages for <em>fstab</em> (which is likely going to be different depending on whether your distro defaults to using <strong>libata</strong> or not), or check out the <strong>LQ</strong> wiki here: <a href="http://wiki.linuxquestions.org/wiki/Fstab" rel="nofollow">http://wiki.linuxquestions.org/wiki/Fstab</a></p> <p>Well I hope that helps!</p>tallshipSat, 15 May 2010 00:18:39 -0400http://linuxexchange.org/questions/589/what-are-the-default-partition-names-in-linux/597