 




<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Source Software and Linux &#187; filesystem label</title>
	<atom:link href="http://itknowledgeexchange.techtarget.com/linux-lotus-domino/tag/filesystem-label/feed/" rel="self" type="application/rss+xml" />
	<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino</link>
	<description></description>
	<lastBuildDate>Thu, 02 May 2013 21:07:56 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Filesystem Labels &#8211; They are important</title>
		<link>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/filesystem-labels-they-are-important/</link>
		<comments>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/filesystem-labels-they-are-important/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 02:15:11 +0000</pubDate>
		<dc:creator>Xjlittle</dc:creator>
				<category><![CDATA[/etc/fstab]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[filesystem label]]></category>
		<category><![CDATA[label]]></category>
		<category><![CDATA[linux label]]></category>

		<guid isPermaLink="false">http://itknowledgeexchange.techtarget.com/linux-lotus-domino/filesystem-labels-they-are-important/</guid>
		<description><![CDATA[Labeling your filesystems can save you a major headache. Using that label in /etc/fstab is key to keeping your disks mounted where they belong. Disks in Linux are assigned special device files. Anytime you replace a drive Linux is liable to change that file based on the order which it sees the new disk. Filesystem [...]]]></description>
				<content:encoded><![CDATA[<p>Labeling your filesystems can save you a major headache.  Using that label in /etc/fstab is key to keeping your disks mounted where they belong.</p>
<p>Disks in Linux are assigned special device files.  Anytime you replace a drive Linux is liable to change that file based on the order which it sees the new disk.  Filesystem labels provide an alternative way for Linux to identify the partitions and drive and mount them where they belong.</p>
<p>On Red Hat systems partitions are automatically labeled if they are created during install.  You can check this out by using the command<br />
<code><br />
[root@centos5-lt ~]# e2label /dev/sda1<br />
/boot<br />
[root@centos5-lt ~]#<br />
</code></p>
<p>You can also see this in /etc/fstab:<br />
<code><br />
[root@centos5-router ~]# cat /etc/fstab<br />
LABEL=/                 /                       ext3    defaults        1 1<br />
LABEL=/var              /var                    ext3    defaults        1 2<br />
LABEL=/home             /home                   ext3    defaults        1 2<br />
LABEL=/boot             /boot                   ext3    defaults        1 2<br />
/dev/router/backups     /backups                ext3    user,defaults   1 2<br />
tmpfs                   /dev/shm                tmpfs   defaults        0 0<br />
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0<br />
sysfs                   /sys                    sysfs   defaults        0 0<br />
proc                    /proc                   proc    defaults        0 0<br />
LABEL=SWAP-hda6         swap                    swap    defaults        0 0<br />
[root@centos5-router ~]#<br />
</code></p>
<p>As system administration goes though we create partitions with labels.  We then put the path to the device file in /etc/fstab and point it to the mount point.  This could present a problem when replacing a disk in your machine.</p>
<p>To label an existing partition use the e2label command.<br />
<code><br />
[root@centos5-router ~]# e2label /dev/router/backups backups<br />
[root@centos5-router ~]# e2label /dev/router/backups<br />
backups<br />
[root@centos5-router ~]#<br />
</code></p>
<p>Now we can change our entry in fstab to use the labe for our backups filesystem and check that it works with mount -a:<br />
<code><br />
LABEL=/backups          /backups                ext3    user,defaults   1 2<br />
[root@centos5-router ~]# mount -a<br />
[root@centos5-router ~]#<br />
</code><br />
Mount will return without any output if you have entered the label correctly.</p>
<p>The easiest way to label a new partition is to do it when you create the partition:<br />
<code><br />
mkefs -j -L /newDisk /dev/sdaX<br />
</code><br />
This will give us a journaled ext3 filesystem with a label of newDisk.  If we want to mount the directory /test on this our entry into /etc/fstab would look like this:<br />
<code><br />
LABEL=/newDisk    /test    ext3    user,defaults, 1 2<br />
</code></p>
<p>Now you know why you want to label your partitions.  Save yourself a major headache and get them labeled!</p>
<p>-j</p>
<!-- wpms-network-global-inserts -->]]></content:encoded>
			<wfw:commentRss>http://itknowledgeexchange.techtarget.com/linux-lotus-domino/filesystem-labels-they-are-important/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
