<?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>Gettin' My Geek On &#187; CentOS</title>
	<atom:link href="http://www.markstevens20.net/blog/tag/centos/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.markstevens20.net/blog</link>
	<description>Ramblings on my experiments with Linux, networking, and collaboration aps</description>
	<lastBuildDate>Sat, 30 Jan 2010 01:23:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>NFSv4 Configuration</title>
		<link>http://www.markstevens20.net/blog/2009/09/nfsv4-configuration/</link>
		<comments>http://www.markstevens20.net/blog/2009/09/nfsv4-configuration/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 01:35:35 +0000</pubDate>
		<dc:creator>Mark Stevens</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[virtualization]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[HomeNetworking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.markstevens20.net/blog/?p=278</guid>
		<description><![CDATA[Having figured out Samba shares, I thought I would tackle remote file systems between Linux machines using NFS (Network File Service). The documentation looked clear enough, but it wasn&#8217;t quit as easy as I expected, largely due to the differences between version 3 and 4 of NFS with respect to: firewall behavior exporting file system [...]]]></description>
			<content:encoded><![CDATA[<p>Having figured out <a href="http://www.markstevens20.net/blog/2009/06/linux-windows-xp-home-networking/" target="_blank" title="my Samba config blog post">Samba shares</a>, I thought I would tackle remote file systems between Linux machines using NFS (Network File Service).  The <a href="http://www.centos.org/docs/5/html/5.2/Deployment_Guide/ch-nfs.html" target="_blank" title="Centos.org doc for NFS">documentation</a> looked clear enough, but it wasn&#8217;t quit as easy as I expected, largely due to the differences between version 3 and 4 of NFS with respect to:</p>
<ul>
<li>firewall behavior</li>
<li>exporting file system syntax and use of pseudo file systems</li>
<li>difference in mount command syntax</li>
</ul>
<p>I am running systems that use SELinux and <a href="#footnote" title="link to blog footnote">firewalls*</a>.  I have one Centos 5.3 NFS server and three client machines running as <a href="#footnote" title="link to blog footnote">virtual machines**</a> on the server.  My goal was to establish remote file systems for the virtual machine clients. I&#8217;ll skip some of the introductory steps to set up the nfs server process that are listed in the <a href="http://www.centos.org/docs/5/html/5.2/Deployment_Guide/ch-nfs.html" target="_blank" title="Centos.org doc for NFS">doc</a>.</p>
<p>I&#8217;ll list the commands that I used to export the file system from the server and the mount command I first used on the client.  The file system that I was attempting to export was /junk/client1.  On the server (server.stevens.net), I added the following to /etc/exports:</p>
<div class="code">
[root@sserver ~]# <b>vi /etc/exports</b><br />
<b>/junk/client1  client1.stevens.net(rw)</b> <i>(:wq!)</i><br />
[root@sserver /]# <b>exportfs -rv</b><br />
[root@sserver /]# exportfs -rv<br />
exporting client1.stevens.net:/junk/client1<br />
[root@sserver /]# service nfs restart<br />
Shutting down NFS mountd:                                  [  OK  ]<br />
Shutting down NFS daemon:                                  [  OK  ]<br />
Shutting down NFS quotas:                                  [  OK  ]<br />
Shutting down NFS services:                                [  OK  ]<br />
Starting NFS services:                                     [  OK  ]<br />
Starting NFS quotas:                                       [  OK  ]<br />
Starting NFS daemon:                                       [  OK  ]<br />
Starting NFS mountd:                                       [  OK  ]
</div>
<p>and I used the following mount command on client1.stevens.net (and received the error shown):</p>
<div class="code">
[root@client1 ~]# <b>mount -t nfs4 sserver.stevens.net:/junk/client1 /remotesys</b><br />
mount.nfs4: sserver.stevens.net:/junk/client1 failed, reason given by server: No<br />
such file or directory.
</div>
<p>A bit surprised that it didn&#8217;t work, I poked around the Internet and I found some good info that ultimately helped me get on the right track at <a href="http://www.brennan.id.au/19-Network_File_System.html#nfs4" target="_blank" title="http://www.brennan.id.au/index.html"> Miles Brennan&#8217;s Linux Home Server HOWTO page</a>. He does an excellent job explaining the pseudo file system configuration required for version 4 of NFS.</p>
<p>I built out the following psuedo file system on the server:</p>
<div class="code">
[root@sserver /]# <b>mkdir NFS4exports</b><br />
[root@sserver /]# <b>cd NFS4exports</b><br />
[root@sserver NFS4exports]# <b>mkdir client1</b><br />
[root@sserver NFS4exports]# <b>mkdir client2</b>
</div>
<p>I then created bindings in /etc/fstab between /NFS4exports and /junk directories as follows (Bindings are like symbolic links, but the files are available in both filesystems, rather than being linked to the source location.):</p>
<div class="code">
[root@sserver /]# <b>vi /etc/fstab</b><br />
<b>/junk/client1            /NFS4exports/client1    none    bind         0 0<br />
/junk/client2            /NFS4exports/client2    none    bind         0 0</b><br />
[root@sserver /]# <b>mount -a -t none</b><br />
[root@sserver /]# <b>cd /NFS4exports/client1</b><br />
[root@sserver client1]# <b>ls -ltr</b> <i> This actually displays the files &#038; directories in the /junk/client1/ directory. </i><br />
total 24<br />
drwxrwxrwx 2 root root 4096 Sep  7 13:38 backup<br />
drwxrwxrwx 2 root root 4096 Sep  7 13:38 filestore<br />
-rwxrwxrwx 1 root root   39 Sep  7 13:41 client1.txt
</div>
<p>Then I list the pseudo file systems in the /etc/exports file, and it is critical to note that the fsid=0 option be defined on the /NFS4exports file system (even though /NFS4exports itself will not be mounted by a remote client).  Then all exported file systems are sub-directories of this system.  If I had additional file systems elsewhere on the server that I wanted to share (say, /home), I would need to create an entry in the pseudo file system and bind it to /home in fstab.</p>
<div class="code">
[root@sserver client1]# <b>vi /etc/exports<br />
/NFS4exports *.stevens.net(ro,fsid=0)<br />
/NFS4exports/client1 client1.stevens.net(rw,nohide)</b><br />
<b>/NFS4exports/client2 client2.stevens.net(rw,nohide)</b><br />
<i>then export with <b>exportfs -rv</b> and restart nfs</i>
</div>
<p>Then I mounted the file systems from the client1 system.  A major difference between the NFSv3 and NFSv4 command is that the root pseudo filesystem is <b>not</b> included in the identity of the remote file system (i.e., the NFS4exports directory is omitted from the command.</p>
<div class="code">
[root@client1 /]# <b>mount -t nfs4 sserver.stevens.net:/client1 /remotesys</b><br />
[root@client1 /]# <b>ls -ltr /remotesys</b><br />
total 24<br />
drwxrwxrwx 2 root root 4096 Sep 7 13:38 backup<br />
drwxrwxrwx 2 root root 4096 Sep 7 13:38 filestore<br />
-rwxrwxrwx 1 root root 39 Sep 7 13:41 client1.txt
</div>
<p>And on client2, showing an example that it can mount the client1 directory, but can&#8217;t see anything or write to it:</p>
<div class="code">
[root@client2 /]# <b>mount -t nfs4 sserver.stevens.net:/client1 /remotesys</b><br />
[root@client2 /]# <b> cd /remotesys</b><br />
[root@client2 remotesys]# <b>ls</b><br />
[root@client2 remotesys]# <b>mkdir test</b><br />
mkdir: cannot create director &#8216;test&#8217;: Read-only file system<br />
[root@client2 remotesys]# <b>cd..</b><br />
root@client2 /]# <b>umount /remotesys</b><br />
[root@client2 /]# <b>mount -t nfs4 sserver.stevens.net:/client2/remotesys</b><br />
[root@client2 /]# <b> cd /remotesys</b><br />
[root@client2 remotesys]# <b>ls -ltr</b><br />
total 24<br />
drwxrwxrwx 2 root root 4096 Sep 7 13:38 backup<br />
drwxrwxrwx 2 root root 4096 Sep 7 13:38 filestore<br />
-rwxrwxrwx 1 root root 39 Sep 7 13:41 client2.txt
</div>
<p>And that completed my setup (except to modify /etc/fstab so that the new /remotesys file system will automount at boot).  The main point was to learn about NFS, but I also ended up with a way to provide storage for my virtual machines outside of the .vmdk virtual file system.<br />
<a name="footnote" id="footnote"></a><br />
<i><br />
Footnotes:<br />
* NFSv4 plays better with firewall because, unlike NFSv3, it does not make use of portmapper and rpc.mountd, rpc.statd, and rpc.lockd. I just had to open port 2049 on the firewall for NFS. However, during some troubleshooting, I needed to execute &#8220;showmount -e sserver.stevens.net&#8217; from a client machine.  The firewall blocked it, because it uses rpc.mountd and portmapper picks a random port by default.  I used /etc/sysconfig/nfs to define a static port for rpc.mountd and then opened this port on the firewall too.<br />
**  As a side note with respect to the virtualization setup, I created one vm and installed a small, simple Centos image.  Then I copied the files twice to new folders in /var/lib/vmware/VirtualMachines. Then I imported these virtual machines into VMware Server to quickly make some clones.  Just a quick edit of the /etc/sysconfig/network file to update each machine to a unique hostname, and I had 3 distinct client machines.</i></p>
]]></content:encoded>
			<wfw:commentRss>http://www.markstevens20.net/blog/2009/09/nfsv4-configuration/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Cookbook for Linux filesystems</title>
		<link>http://www.markstevens20.net/blog/2009/08/cookbook-for-linux-filesystems/</link>
		<comments>http://www.markstevens20.net/blog/2009/08/cookbook-for-linux-filesystems/#comments</comments>
		<pubDate>Sun, 09 Aug 2009 19:39:15 +0000</pubDate>
		<dc:creator>Mark Stevens</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.markstevens20.net/blog/?p=170</guid>
		<description><![CDATA[I added a new 500GB HDD to the Linux home PC. This drive will be dedicated to Samba shares for our home PC that has exhausted its 80GB hard drive. This gave me an opportunity to set up file systems on the Linux machine, a great learning opportunity. I decided to set up a 250GB physical volume called ‘/storage’ that would hold our multimedia files’ and a 250GB logical volume group, 100GB of which would be a ‘/backup’ volume to act as a backup drive for the home PC files (currently being backed up to CD-RW) and a 100GB drive called ‘/junk’ which has no other purpose than giving me a second logical volume in the volume group. Going forward, I’ll create file systems as all logical volumes, because these are easier to resize in the future. But using a physical volume for /storage game me a chance to set up both.
What follows is a cookbook for each scenario, the physical volume /storage and the logical volumes /backup and /junk. ]]></description>
			<content:encoded><![CDATA[<p>I added a new 500GB HDD to the Linux home PC.  This drive will be dedicated to Samba shares for our home PC that has exhausted its 80GB hard drive.  This gave me an opportunity to set up file systems on the Linux machine, a great learning opportunity.  I decided to set up a 250GB physical volume called &#8216;/storage&#8217; that would hold our multimedia files&#8217; and a 250GB logical volume group, 100GB of which would be a &#8216;/backup&#8217; volume to act as a backup drive for the home PC files (currently being backed up to CD-RW) and a 100GB drive called &#8216;/junk&#8217; which has no other purpose than giving me a second logical volume in the volume group.  Going forward, I&#8217;ll create all file systems as  logical volumes, because these are easier to resize in the future. But using a physical volume for /storage game me a chance to experience the set up both.<br />
What follows is a cookbook for each scenario, the physical volume /storage and the logical volumes /backup and /junk. I include all of the output of the system during the build.  I don&#8217;t spend much time explaining the commands.  For more information, review the man pages for the specific command, or post questions in the comment section.</p>
<div class="code">[root@sserver ~]# <b>fdisk /dev/sdb</b><br />
The number of cylinders for this disk is set to 60801.<br />
There is nothing wrong with that, but this is larger than 1024,<br />
and could in certain setups cause problems with:<br />
1) software that runs at boot time (e.g., old versions of LILO)<br />
2) booting and partitioning software from other OSs<br />
   (e.g., DOS FDISK, OS/2 FDISK)</p>
<p>Command (m for help): <b>n</b><br />
Command action<br />
   e   extended<br />
   p   primary partition (1-4)<br />
p<br />
Partition number (1-4): <b>1</b><br />
First cylinder (1-60801, default 1):<br />
Using default value 1<br />
Last cylinder or +size or +sizeM or +sizeK (1-60801, default 60801): <b>+250000M</b> <i> Note: Should have done this as 256000M to get a 250G partition.  duh. </i></p>
<p>Command (m for help): <b>p</b></p>
<p>Disk /dev/sdb: 500.1 GB, 500107862016 bytes<br />
255 heads, 63 sectors/track, 60801 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes</p>
<p>   Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1               1       30395   244147806   83  Linux</p>
<p>Command (m for help): <b>w</b><br />
The partition table has been altered!</p>
<p>Calling ioctl() to re-read partition table.</p>
<p>WARNING: Re-reading the partition table failed with error 16: Device or resource busy.<br />
The kernel still uses the old table.<br />
The new table will be used at the next reboot.<br />
Syncing disks.<br />
[root@sserver ~]#
</p></div>
<p>Then reboot the system, and make and mount the volumes.</p>
<div class="code">[root@sserver ~]# <b>mke2fs -j /dev/sdb1</b><br />
mke2fs 1.39 (29-May-2006)<br />
Filesystem label=<br />
OS type: Linux<br />
Block size=4096 (log=2)<br />
Fragment size=4096 (log=2)<br />
30523392 inodes, 61036951 blocks<br />
3051847 blocks (5.00%) reserved for the super user <i> See notes below regarding reserved space </i><br />
First data block=0<br />
Maximum filesystem blocks=4294967296<br />
1863 block groups<br />
32768 blocks per group, 32768 fragments per group<br />
16384 inodes per group<br />
Superblock backups stored on blocks:<br />
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,<br />
        4096000, 7962624, 11239424, 20480000, 23887872</p>
<p>Writing inode tables: done<br />
Creating journal (32768 blocks): done<br />
Writing superblocks and filesystem accounting information: done</p>
<p>This filesystem will be automatically checked every 35 mounts or<br />
180 days, whichever comes first.  Use tune2fs -c or -i to override.<br />
[root@sserver ~]# <b>mkdir /storage</b><br />
[root@sserver ~]# <b>mount -t ext3 /dev/sdb1 /storage</b><br />
[root@sserver ~]# <b>mount | grep storage</b><br />
/dev/sdb1 on /storage type ext3 (rw)<br />
[root@sserver ~]#<br />
<i> Add a line to /etc/fstab so that the new volume will mount automatically at startup. Done with vi editor</i><br />
<b>/dev/sdb1               /storage                 ext3    defaults        1 2</b>
</div>
<p>Now, This volume will be used only as a Samba share.  As discussed <a href="http://www.walkernews.net/2007/02/28/tune2fs-increase-linux-free-disk-space/" target="_blank" title="http://www.walkernews.net">here by Walker,</a> we do not need to reserve block space for the root user or system logs.  Here is how to adjust it:</p>
<div class=code>
[root@sserver /]# <b>df -h /storage</b> <i>Display volumes for reference</i><br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/sdb1             230G   32G  186G  15% /storage<br />
[root@sserver /]# <b>tune2fs -m 0 /dev/sdb1</b><br />
tune2fs 1.39 (29-May-2006)<br />
Setting reserved blocks percentage to 0% (0 blocks)<br />
[root@sserver /]# <b>df -h /storage</b><br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/sdb1             230G   32G  198G  14% /storage
</div>
<p>Ta-da! Now, on to a Logical Volumes. Logical volumes take more work to create and are more difficult to understand, but a quick read of <a href="http://www.centos.org/docs/5/html/5.2/Deployment_Guide/ch-lvm.html" target="_blank"> Chapter 9 of the of the Redhat Deployment Guide</a> will get you through.  However, the deployment guide does not have a quick command line guide for creating LVMs.<br />
 I&#8217;m going to make a logical volume group VolGroup02, with two logical volumes, LogVol00 and LogVol01, each logical volume will be 100GB.  I&#8217;ll start with the creation of the physical partition /dev/sdb2 using fdisk.</p>
<div class="code">
[root@sserver ~]# <b>fdisk /dev/sdb</b></p>
<p>The number of cylinders for this disk is set to 60801.<br />
There is nothing wrong with that, but this is larger than 1024,<br />
and could in certain setups cause problems with:<br />
1) software that runs at boot time (e.g., old versions of LILO)<br />
2) booting and partitioning software from other OSs<br />
   (e.g., DOS FDISK, OS/2 FDISK)<br />
Command (m for help): <b>p</b><br />
Disk /dev/sdb: 500.1 GB, 500107862016 bytes<br />
255 heads, 63 sectors/track, 60801 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
   Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1               1       30395   244147806   83  Linux<br />
Command (m for help): <b>n</b><br />
Command action<br />
   e   extended<br />
   p   primary partition (1-4)<br />
<b>p</b><br />
Partition number (1-4): <b>2</b><br />
First cylinder (30396-60801, default 30396): <i>hit enter to take default</i><br />
Using default value 30396<br />
Last cylinder or +size or +sizeM or +sizeK (30396-60801, default 60801): <i>hit enter to take default</i><br />
Using default value 60801<br />
Command (m for help): <b>p</b><br />
Disk /dev/sdb: 500.1 GB, 500107862016 bytes<br />
255 heads, 63 sectors/track, 60801 cylinders<br />
Units = cylinders of 16065 * 512 = 8225280 bytes<br />
   Device Boot      Start         End      Blocks   Id  System<br />
/dev/sdb1               1       30395   244147806   83  Linux<br />
/dev/sdb2           30396       60801   244236195   83  Linux<br />
Command (m for help): <b>w</b><br />
The partition table has been altered!<br />
Calling ioctl() to re-read partition table.<br />
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.<br />
The kernel still uses the old table.<br />
The new table will be used at the next reboot.<br />
Syncing disks.
</div>
<p>Then initialize the physical volume for use by LVM, create the Volume Group and Logical Volumes.</p>
<div class="code">
[root@sserver dev]# <b>pvcreate /dev/sdb2</b><br />
  Physical volume &#8220;/dev/sdb2&#8243; successfully created<br />
[root@sserver dev]# <b>vgcreate VolGroup02 /dev/sdb2</b><br />
  Volume group &#8220;VolGroup02&#8243; successfully created<br />
[root@sserver dev]# <b>vgs VolGroup02</b> <i>display the new volume group</i><br />
  VG         #PV #LV #SN Attr   VSize   VFree<br />
  VolGroup02   1   0   0 wz&#8211;n- 232.92G 232.92G<br />
[root@sserver dev]# <b>lvcreate -L 100G -n LogVol00 VolGroup02</b><br />
  Logical volume &#8220;LogVol00&#8243; created<br />
[root@sserver dev]# <b>lvcreate -L 100G -n LogVol01 VolGroup02</b><br />
  Logical volume &#8220;LogVol01&#8243; created<br />
[root@sserver dev]# <b>lvs /dev/VolGroup02</b> <i>display the new logical volumes</i><br />
  LV       VG         Attr   LSize   Origin Snap%  Move Log Copy% Convert<br />
  LogVol00 VolGroup02 -wi-a- 100.00G<br />
  LogVol01 VolGroup02 -wi-a- 100.00G
</div>
<p>Then create the file systems, remove the reserved the space, make and mount the file systems.</p>
<div class="code">
[root@sserver /]# <b>mkfs -t ext3 -v /dev/VolGroup02/LogVol00</b><br />
mke2fs 1.39 (29-May-2006)<br />
Filesystem label=<br />
OS type: Linux<br />
Block size=4096 (log=2)<br />
Fragment size=4096 (log=2)<br />
13107200 inodes, 26214400 blocks<br />
1310720 blocks (5.00%) reserved for the super user<br />
First data block=0<br />
Maximum filesystem blocks=4294967296<br />
800 block groups<br />
32768 blocks per group, 32768 fragments per group<br />
16384 inodes per group<br />
Superblock backups stored on blocks:<br />
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,<br />
        4096000, 7962624, 11239424, 20480000, 23887872<br />
Writing inode tables: done<br />
Creating journal (32768 blocks): done<br />
Writing superblocks and filesystem accounting information: done<br />
This filesystem will be automatically checked every 35 mounts or<br />
180 days, whichever comes first.  Use tune2fs -c or -i to override.<br />
[root@sserver /]# <b>tune2fs -m 0 /dev/VolGroup02/LogVol00</b><br />
tune2fs 1.39 (29-May-2006)<br />
Setting reserved blocks percentage to 0% (0 blocks)<br />
[root@sserver /]# <b>mkfs -t ext3 -v /dev/VolGroup02/LogVol01</b><br />
mke2fs 1.39 (29-May-2006)<br />
Filesystem label=<br />
OS type: Linux<br />
Block size=4096 (log=2)<br />
Fragment size=4096 (log=2)<br />
13107200 inodes, 26214400 blocks<br />
1310720 blocks (5.00%) reserved for the super user<br />
First data block=0<br />
Maximum filesystem blocks=4294967296<br />
800 block groups<br />
32768 blocks per group, 32768 fragments per group<br />
16384 inodes per group<br />
Superblock backups stored on blocks:<br />
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,<br />
        4096000, 7962624, 11239424, 20480000, 23887872<br />
Writing inode tables: done<br />
Creating journal (32768 blocks): done<br />
Writing superblocks and filesystem accounting information: done<br />
This filesystem will be automatically checked every 24 mounts or<br />
180 days, whichever comes first.  Use tune2fs -c or -i to override.<br />
[root@sserver /]# <b>tune2fs -m 0 /dev/VolGroup02/LogVol00</b><br />
tune2fs 1.39 (29-May-2006)<br />
Setting reserved blocks percentage to 0% (0 blocks)<br />
[root@sserver backup]# <b>mkdir /backup</b><br />
[root@sserver backup]# <b>mkdir /junk</b><br />
[root@sserver backup]# <b>mount /dev/VolGroup02/LogVol00 /backup</b><br />
[root@sserver backup]# <b>mount /dev/VolGroup02/LogVol01 /junk</b><br />
[root@sserver backup]# <b>mount | grep VolGroup02</b><br />
<i> Then add the following to /etc/fstab so the mount automatically at startup: </i><br />
<b>/dev/VolGroup02/LogVol00 /backup                 ext3    defaults        1 2<br />
/dev/VolGroup02/LogVol01 /junk                   ext3    defaults        1 2</b></p>
<p>[root@sserver ~]# <b>df -h /backup /junk</b> <i> display the new volumes</i><br />
Filesystem            Size  Used Avail Use% Mounted on<br />
/dev/mapper/VolGroup02-LogVol00<br />
                       99G  188M   99G   1% /backup<br />
/dev/mapper/VolGroup02-LogVol01<br />
                       99G  188M   99G   1% /junk
</div>
<p>And it is almost that easy.  I did have some problems at the outset of this endeavor.   After I installed the 500GB drive, I re-installed Linux (for an unrelated reason).  I had thought that the installation ignored the 500GB drive, however, I learned that the <a href="http://www.centos.org/docs/5/html/5.2/Deployment_Guide/s1-lvm-diskdruid-auto.html" target="_blank">installation process will allocate all unused space into a logical volume</a>.  I was confused at first when it would not make the filesystem, citing that it was in use.  <a href="https://www.centos.org/modules/newbb/viewtopic.php?topic_id=21177&#038;forum=39" target="_blank">The folks over at the centos.org forum were able to help me out and get me on track.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.markstevens20.net/blog/2009/08/cookbook-for-linux-filesystems/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux &#8211; Windows XP Home Networking</title>
		<link>http://www.markstevens20.net/blog/2009/06/linux-windows-xp-home-networking/</link>
		<comments>http://www.markstevens20.net/blog/2009/06/linux-windows-xp-home-networking/#comments</comments>
		<pubDate>Sat, 13 Jun 2009 19:54:19 +0000</pubDate>
		<dc:creator>Mark Stevens</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[computer]]></category>
		<category><![CDATA[HomeNetworking]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PC]]></category>
		<category><![CDATA[storage]]></category>

		<guid isPermaLink="false">http://www.markstevens20.net/blog/?p=88</guid>
		<description><![CDATA[I want to play with computers and networking.  My family doesn&#8217;t.  They are content with a basic Windows XP PC with email, web browsing and support for MP3 players and digital cameras.  Our XP PC is 5 years old and has exhausted its 80 GB hard drive.  Rather than buying a new Vista machine, I [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/ehecatzin/63760739/"><img class="alignright" src="http://farm1.static.flickr.com/31/63760739_42e72b9ed1.jpg?v=0" alt="" width="320" height="240" /></a>I want to play with computers and networking.  My family doesn&#8217;t.  They are content with a basic Windows XP PC with email, web browsing and support for MP3 players and digital cameras.  Our XP PC is 5 years old and has exhausted its 80 GB hard drive.  Rather than buying a new Vista machine, I decided to <a title="Building a PC blog post" href="http://www.markstevens20.net/blog/?p=30" target="_blank">buy the parts to make a PC</a>, then <a title="Loading CentOS blog post" href="http://www.markstevens20.net/blog/?p=74" target="_blank">loaded CentOS Linux on it.</a> In addition to the new Liunx machine&#8217;s function as a &#8216;lab&#8217; for me to play with, it also had to provide additional storage and backup facilities for the family&#8217;s XP machine.   I know the simpler thing to do would be to simply buy a USB HDD for the XP machine, but this isn&#8217;t about simple, it&#8217;s about creating &#8216;learning opportunities.&#8217;</p>
<p>So, I have a Linux machine with tons of HDD storage space  (250 + 500 GB) .  The XP machine needs additional space.  And it must be transparent to the rest of the family.  I used <a title="http://us1.samba.org/samba/" href="http://us1.samba.org/samba/" target="_blank">Samba</a> to create file shares on the Linux machine, then created mapped network drives on the XP machine that connect automatically to the Linux machine&#8217;s HDDs at login.  It wasn&#8217;t hard, but did trip me up on a couple points.</p>
<p>Samba is an open source software package that allows Linux/Unix machines to participate in Windows networking as nodes in the Windows &#8220;Network Neighborhood&#8221; and therefore provide file sharing between Linux and Windows machines.  It was easy to install the Samba package on CentOS, using the Add/Remove software package from the desktop GUI, and included a GUI configuration tool for Samba.  The <a title="Depolyment Guide Samba Chapter" href="http://www.centos.org/docs/5/html/5.2/Deployment_Guide/ch-samba.html" target="_blank">CentOS deployment guide</a> provides good guidance for configuration, and the <a title="samba.org" href="http://us6.samba.org/samba/" target="_blank">samba.org</a> site provide an excellent extra level of detail for the software.  A couple of points to add that were key learnings for me:</p>
<ol>
<li><a href="http://www.markstevens20.net/blog/wp-content/uploads/2009/06/screenshot-package-manager.png"><img class="alignright size-medium wp-image-96" title="Samba Packages" src="http://www.markstevens20.net/blog/wp-content/uploads/2009/06/screenshot-package-manager-300x213.png" alt="Samba Packages" width="300" height="213" /></a>The Samba GUI provides a simple, easy configuration tool for the basic samba config, identifying the workgroup name, shared volumes and users/passwords.  The manual config is accomplished via the smb.conf file in /etc/samba.  Manual edit of the conf file provides more options than the GUI, including logging level, source IP address filtering, and preventing access to home directory.  However, if you make changes to this conf file, then make changes to the config via the GUI, your manual changes to the conf file will be removed.  So make the simple GUI config changes first, get a functioning system, then tweak the configuration with vi edits of the smb.conf file.</li>
<li>Windows XP required that I set samba up with &#8220;user&#8221; authentication, not &#8220;share&#8221;, and I had to encrypt the passwords on the Samba config.  Windows would not attempt to make connections when Samba was configured with unencrypted passwords.</li>
</ol>
<p>The Samba config was easier to config than the Windows XP side.  Once I had the Samba server running, I was able to go into &#8220;Network Neighborhood&#8221;, view the &#8220;workgroup nodes&#8221; and connect with the user/password set up in Samba.  Then I could map a drive letter to a share folder on the Linux box.  Easy, right?  Almost.  Even though I asked Windows to &#8216;reconnect at login&#8217;, Windows could not.  Looking at the Samba logs in var/log/samba/smbd.log (with logging set to level 3 via the conf file &#8220;log level = 3) I could tell that the problem was with XP, not Samba, and I suspect that Windows was not chaching the password.</p>
<p>The solution was a batch file that runs at startup on the XP machine.  I f<a title="http://www.watchingthenet.com/create-a-batch-file-to-map-drives-folders.html" href="http://www.watchingthenet.com/create-a-batch-file-to-map-drives-folders.html" target="_blank">ound a forum post</a> that explained the syntax very well, using the net use command.  My specific command was &#8220;net use S: \\server\storage passwd /USER:username&#8221;  Then I just had to store the batch file in the &#8216;startup&#8217; programs folder for &#8220;All Users&#8221;, and now the drive maps automatically at startup.  Then I&#8217;ll convert the &#8220;My Pictures&#8221; folder to a shortcut to a folder on the Samba shared volume.  Perfectly transparent to my family.</p>
<p>As long as the power is on the Linux box.</p>
<p><strong>Update Jul 20, 2009:</strong></p>
<p>I rebuilt my machine and used a firewall and Security Enhanced Linux (SELinux), which created a couple additional challenges.  First, the firewall had to be configured to allow smb protocol for Samba, which was easy.  Second, (and a bit more tricky) the smb.conf file had notes for SELinux, indicating that the shared folders needed to be marked with &#8220;samba_share_t&#8221;. The current labels can be displayed with &#8220;ls -ldZ /path&#8221;, and the label on a share folder can be set with &#8220;chcon -t samba_share_t /path&#8221;.<strong> </strong>Once I resolved these issues, all was fine.<strong><br />
</strong></p>
<p>Photo credit, <a title="http://www.flickr.com/photos/ehecatzin/63760739/" href="http://www.flickr.com/photos/ehecatzin/63760739/" target="_blank">eheçatzin</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.markstevens20.net/blog/2009/06/linux-windows-xp-home-networking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Centos 5.3 Install</title>
		<link>http://www.markstevens20.net/blog/2009/06/centos-53-install/</link>
		<comments>http://www.markstevens20.net/blog/2009/06/centos-53-install/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 19:51:30 +0000</pubDate>
		<dc:creator>Mark Stevens</dc:creator>
				<category><![CDATA[Infrastructure]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://www.markstevens20.net/blog/?p=74</guid>
		<description><![CDATA[After completing the build of the new PC, I set out to load a version of Linux.  While it seamed that most folks who had bought my ASUS motherboard had successfully installed Ubuntu, I wanted to go with CentOS, because it is based on the Red Hat Enterprise distribution and I had used it some [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-75" title="centoslogo" src="http://www.markstevens20.net/blog/wp-content/uploads/2009/06/centoslogo.png" alt="centoslogo" width="434" height="121" />After completing the build of the new PC, I set out to load a version of Linux.  While it seamed that most folks who had bought my ASUS motherboard had successfully installed <a title="http://www.ubuntu.com/" href="http://www.ubuntu.com/" target="_blank">Ubuntu</a>, I wanted to go with <a title="http://centos.org/" href="http://centos.org/" target="_blank">CentOS</a>, because it is based on the Red Hat Enterprise distribution and I had used it some at work to build an Asterisk PBX, something I may do with this machine too.</p>
<p>I downloaded the latest CentOS, <a title="5.3 x86_64 mirror sites" href="http://isoredirect.centos.org/centos/5/isos/x86_64/" target="_blank">5.3 x86_64</a> (verified with a nice <a title="http://support.microsoft.com/kb/841290" href="http://support.microsoft.com/kb/841290" target="_blank">MD5 calculator</a> from Microsoft), burned 7 .iso CD&#8217;s using our old PC, dropped disk 1 into the new PC&#8217;s DVD/CD drive, powered on and seemed to make some progress&#8230;but after a few text based screens realized that CentOS could not recognize my <a title="wikipedia SATA page" href="http://en.wikipedia.org/wiki/SATA" target="_blank">SATA</a> HDD nor DVD/CD and would not launch the install GUI.  I was able to rig a connection between my old PC&#8217;s <a title="wikipedia IDE page" href="http://en.wikipedia.org/wiki/AT_Attachment" target="_blank">IDE</a> CD drive to the new PC&#8217;s motherboard, changed boot preference in BIOS and was able to make better progress.  The install package would now launch its GUI, only to tell me that it could not find a HDD to partition.  Grrr&#8230;</p>
<p>I did some research on the web, and as with most things, I was not the first person to have this problem.  I was pretty sure it was an issue with my mobo/chipset and the SATA interface.  I was able to find a <a title="http://www.centos.org/modules/newbb/viewtopic.php?topic_id=16542&amp;forum=39" href="http://www.centos.org/modules/newbb/viewtopic.php?topic_id=16542&amp;forum=39" target="_blank">thread on the CenOS forum</a> page that explained that I needed to type, at the boot prompt of the install: &#8220;linux pci=nomsi boot&#8221;.  Without really knowing what the command meant, I gave it a shot, and it worked.  I&#8217;ve since learned that I was preventing the use of <a title="wikipedia MSI page" href="http://en.wikipedia.org/wiki/Message_Signaled_Interrupts" target="_blank">Message System Interupts</a>,  but don&#8217;t really understand yet why that fixed it.</p>
<p>I ran through a quick install and was pleased to get a booted PC, but quickly became dissapointed when I could not connect to the internet.  No Ethernet port discovered.  Back to the Centos forum.  I suspected an issue with the Ethernet controller, which was also on the chipset (nVidia GeForce 8300) and quickly found <a title="http://www.centos.org/modules/newbb/viewtopic.php?topic_id=19664&amp;forum=40&amp;post_id=74284#forumpost74284" href="http://www.centos.org/modules/newbb/viewtopic.php?topic_id=19664&amp;forum=40&amp;post_id=74284#forumpost74284" target="_blank">some advice that that fixed the problem</a>.  I had to download a module using my old PC, transfer it to the new Linux box via USB stick sneakernet, and install it with rpm. A reboot of the PC (network services restart wasn&#8217;t enough), and I&#8217;m on the internet.  W00t!</p>
<p>By the end of the Memorial Day weekend, I had a functioning PC, ready for some more serious playing.  Maybe a second post later when I find additional components not recognized.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.markstevens20.net/blog/2009/06/centos-53-install/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
