Linux Server Diary

The trials and tribulations of a Linux newbie trying to setup a home server.

Sunday, November 28, 2004

Directory Model Decided

I think I've solved my issues with the directory layout on the new drive and how it relates to Samba. Here's the plan:

On the new drive (/mnt/hdd1) I have setup two folders, the earlier mentioned /home and one called /export. Each is mapped to a folder in /. Under /export, I'll create folders for all of the shared files, including music, pictures, downloads, etc.

Also, to mimic the behavior of the existing share, I'm setting up a folder for each user in the export folder. This will map to the Documents folder in each users home folder.

Starting with the original smb.conf, here are the changes:

smb.conf

in [global]
server string = Samba %v on %L

in [homes]

path = /home/%u/Documents

in [files]

path = /export
create mask = 0777
hide unreadable = yes

To create and mount the /export folder, I use steps similar to those used when moving /home

cd /mnt/hdd1
mkdir export
chmod 0777 export
mkdir export
Add this line to /etc/fstab
/mnt/hdd1/export /export none rw,bind 0 0
mount /mnt/hdd1/export

Finally, to setup the link to the user shares, I use this sequence of steps for each:

Add this line to /etc/fstab
/mnt/hdd1/home/username/Documents /export/Username none rw,bind 0 0
mkdir /export/Username
mount /mnt/hdd1/home/username/Documents

(I'll note here that the Documents folder is apparently created by Mandrake when the user logs into the machine for the first time.)

I'd love to year your thoughts...

Friday, November 26, 2004

smb.conf - The First Try

Basically, I copied an example smb.conf file and modified for my use. This is a basic workgroup server - mostly copying the functionality of my existing Win95 server.

cat /etc/samba/smb.conf

[global]
workgroup = workgroupname

security = user
encrypt passwords = yes

wins support = yes

local master = yes
preferred master = yes
os level = 65

[homes]
comment = %u's Home Directory
browsable = no
read only = no
map archive = yes

[files]

comment = Shared Files
path = /mnt/hdd1
create mask = 0755
read only = no


After entering the file, I restarted Samba services:

/etc/rc.d/init.d/smb restart

Next, I had to add a user to Samba for each family member:

smbpasswd -a username

Seems to work OK. Now, sure, I had intended to setup a Primary Domain Controller, but I was having a tough time figuring out the configuration of Samba and the server. The documentation I've been reading seems to stress different things, and it's hard to tell what is important. I wanted to have something running just to show that I could do it. I think I'll play with this setup a little more to learn more about the program.

Here's the other issue: my Win95 server is out of space, I removed some extra files, but there isn't much headroom. I'll have to move files to this server soon. I don't want to experiment on this server once it becomes a production server, so I'm not sure what will happen next. I may grab the about to be retired IMAP server and use it as a play area.

Thursday, November 25, 2004

Rookie Mistake

It didn't take long to figure out my network problem. I found a typo in the hosts file that I have copied to each workstation. Apparently, I had already corrected the server IP address on the two machines that have been working.

Anyway, since fixing the file on the other two machines, all is well. I wish all of my problems could be solved this easily.

Network Issue

When I setup the NTP service, I downloaded a time set program to each of the four client machines in the house (3 on Win 2K, 1 on Win ME). Two of the machines were able to connect to my time server, while the other two couldn't find it. I instead set them up to use a server at work.

Now, when I try to use the X-Server, the same two machines that could connect to NTP can connect via XDMCP just fine. The third Win 2K machine can see the server, but the Linux login screen never appears.

I wonder if there is some networking issue on these two machines that is causing the problem. All four are using ZoneAlarm and are setup the same way. I can ping the Linux server from all as well. I'll do a little experimentation today and see what I can find.

Wednesday, November 24, 2004

XDM Works!!

I don't know what I did.

I tried X-Deep from my desktop machine - just for fun - and it found a server on the Linux box. I was able to log in and use Gnome. I'm entering this post from Firefox on the server right now.

Since I gave up on the XDM configuration, I have configured NTP and added a 2nd drive. Would either of these make it work? I doubt it. If I don't know what I did, I can't document it in case I need to do it again later.

Anyway, I'll still use it.

Sunday, November 21, 2004

I Moved

Here's how I moved /home to the new drive.
Add this line to /etc/fstab
/mnt/hdd1/home /home none rw,bind 0 0

Move the files to the new folder
cp -a /home/* /mnt/hdd1/home

Remove the /home folder and its contents
rm -rf /home/*

Create a new /home folder
mkdir /home

Mount the folder
mount /mnt/hdd1/home


Not tough!

Moving /home

These guys have a plan

Debian.org - Moving /home to its own partition
Team Phoenix Rising Forums - Copying partitions

Saturday, November 20, 2004

Directory Configuration

Here's what I wish to do. You can tell me if I'm way off. My two goals are to make file sharing via Samba easy for my users (family), while not totally blowing off Linux customs for file directory layouts.

On the existing Win 95 server, I have one shared directory called FILES. Inside are folders for each user, plus for music, pictures, downloads, etc. We map this to the G: drive on our clients. Everyone can see everything.

In the new setup, I'd like to mirror this setup, except I'd like the folders for each user to be the Linux home directory for each. I would still map the G: drive to this share. Also, I'd like to map the H: drive to each user's home directory in a login script. This way, my family would know that the H: drive is theirs, while they could traverse the G: drive to get to the other users' folders if security access is granted to the 'users' group. I imagine that each of us will have private file areas, plus my wife and I will have exclusive access to financial records using a group called 'adults'. I'll probably set things up for them, since they won't have access to (or knowledge of) a Linux prompt and the various chXXX commands. Finally, I plan to setup a periodic backup of the files to another drive on a different machine. I'd like to exclude the music files from this backup, since they are either off of CDs I have, or backed up somewhere else.

I need to figure out how to setup security and groups to pull this off. Here's what I've come up with so far:

The new drive is mounted on /mnt/hdd1. I created two directories - home and music. I can map these directories to other folders using:

mount --bind /mnt/hdd1/music /music
mount --bind /mnt/hdd1/home /testhome

I probably don't have to map the music folder to a root folder, except to make things easier to find. Does this violate any Linux conventions? I'm thinking that I could share the actual path in Samba just fine.

I would map /mnt/hdd1/home to the /home folder once I'm ready.

Here's the part I'm not very clear on. The user directories in /home have both the owner and group set to the username. Should I change the group to the "users" group? Also, should I set "+s" (set group ID) on the non-user folders (music, pictures, etc.) so that everyone can create files there, but they are owned by the folder owner and group?

Leave your comments, opinions, suggestions, praises, and criticisms below. I'd love to hear from you.

Linux File Security Links

Linux Forum - Linux Introduction- File Security
Free OS - Understanding Linux File Permissions

Disk Thing II - The Solution

Remember last time I was stuck on an error:

/dev/hdd1: Invalid argument passed to ext2 library while setting up superblock

I looked up the error in Google. Didn't find any direct help, but I did find another link explaining how to add a new drive:
Partitioning and Formatting a New Drive

In this post, the author creates a primary partition instead of an extended one as I did. After rerunning fdisk with this new information, the format went just fine. below are the corrected instructions:

First, partition the drive. This will erase any data on the disk.

Partition the disk using fdisk
fdisk /dev/hdd

Delete the existing partition
Command: d

Add a new partition
Command: n

Make it PRIMARY
Command action p

Specify the first partition
Partition number (1-4): 1

Start with the first cylinder
First cylinder (1-xxxx, default=1): [enter]

Use them all
Last cylinder (default=xxxx): [enter]

View the results
Command: p

Write the partition table and exit (no undo!)
Command: w


Now, format the drive using ext3.

Issue format command
mkfs -t ext3 /dev/hdd1


The format worked great.

Now let's mount this sucker.

Make a directory for the mount (mine was already there)
mkdir /mnt/hdd1

Add this line to /etc/fstab
/dev/hdd1 /mnt/hdd1 ext3 defaults 0 0

Test the mount
mount /dev/hdd1

Check the results
df

If everything worked, you should see your new drive in the output:
Filesystem            Size  Used Avail Use% Mounted on

/dev/ide/host0/bus0/target0/lun0/part1
6.8G 1.6G 5.0G 24% /
/dev/ide/host0/bus1/target1/lun0/part1
74G 33M 70G 1% /mnt/hdd1

Next time, the new directory layout.

Friday, November 19, 2004

Let's Do This Disk Thing Now

Enough time wasting! Let's get this hard drive working!

First, partition the drive. This will erase any data on the disk.

Partition the disk using fdisk
fdisk /dev/hdd

Delete the existing partition
Command: d

Add a new partition
Command: n

Make it extended
Command action e

Specify the first partition
Partition number (1-4): 1

Start with the first cylinder
First cylinder (1-xxxx, default=1): [enter]

Use them all
Last cylinder (default=xxxx): [enter]

View the results
Command: p

Write the partition table and exit (no undo!)
Command: w


Now, format the drive using ext3.

Issue format command
mkfs -t ext3 /dev/hdd1


Here's the first error of the night:
/dev/hdd1: Invalid argument passed to ext2 library while setting up superblock

That's enough for tonight. More tomorrow.

UPDATE: See the next post for a solution for this error.

NTPD Setup



I modified /etc/ntp.conf to point to the Purdue time servers - as I documented earlier. However, when I restarted the service, it was still talking to pool.htp.org. After a little looking around, I found that server name listed in /etc/ntp/step-tickers. I have no idea what that file is for, and there is no man entry, so I'm going to research.

(10 minutes later)*


I found this page that explains how to setup and use ntp and ntpd, but doesn't say much about step-tickers. A couple other pages I found instruct us to enter the same servers that we entered in the main config file in the step-tickers file, but they didn't say why (except for one that said it would not make big adjustments if my clock was 'screewed').

OK, I found something useful. According to this page, /etc/ntp/step-tickers is used by ntpdate to set the time when the process starts. It only runs if /etc/ntp/step-tickers is present. The author suggests that the startup script start ntpd using the -g option instead of ntpdate. This will let boot up continue while the daemon connects to the time server. Since I'm not that up on scripting, I'll update the file as suggested and leave the script alone for now.

I downloaded a program called Automachron and installed on my desktop. It is an NTP client that I pointed to the new server to get the time. Worked great.

*Sponge Bob fans will read this line in a very bad Jacques Cousteau accent.

Thursday, November 18, 2004

Rough Start

Tonight is the first time in a while when I've had time to work on the server.

I had installed the 80GB drive on Sunday, but then the machine wouldn't boot at all. I was tired, so I left it until today.

Since I had been moving things around in there, I decided to check and/or reseat the network card and all of the various cables. After that, it worked fine.

As the machine booted, it ran a disk configuration utility (harddrake) when it saw the new drive. I'm going to partition, format, etc. manually, but I let the drake do its thing anyway. Because the disk is currently formatted as NTFS, Mandrake can't read it.

It will probably be the weekend before I go to the next step.

Sunday, November 14, 2004

Firing Up the New Drive

I'm taking a break from the X problems for a while. I can use PuTTy to get a text connection.

Now, it's time to start using the 80GB drive in the server. I researched this way back in September, so I'm hoping things go pretty smoothly.

Friday, November 12, 2004

More XDM

I tried a couple of additional steps:

Question MarkI noticed in the syslog that the system is running mdkkdm, not gdm, so I opened /usr/share/config/kdm/kdmrc, found the [xdmcp] section, and changed Enable = false to Enable = true. I logged off and back in (using CTRL-ALT-BACKSPACE). No luck.

I browsed through the rest of the file, and found a line indicating the xdmcp port at 177 to be commented. I uncommented and logged out and back in. Still, nothing.

I'm not sure how to tell if the proper services are running (or even what they are) or how to see if port 177 is open and ready for business.

Thursday, November 11, 2004

Let's Try X-Deep

OK, so I had to run the full install of CygwinX three times because the connection with the mirror kept bombing out (one attempt took over an hour). Then, when I tried to run it, I still got the missing .dll error. I found the file and copied it to the folder with the .exe, ran it, and it asked for another .dll. By this time, I'm pretty frustrated, so I copied all of the .dll's over. Now, when I ran it, it came up.

I tried the command X -query hostname. The X screen came up, but no login. Arrgh!

I think that my problems with this program have to do more with my lack of experience than with the application. Based on Google results, it seems to be the #1 X server for Windows in use. However, they could make it a little easier to download, install, configure, and use. By this time, I was pretty perturbed with the whole thing, so I deleted the app off the hard drive and moved on to the next application, X-Deep.

The installation was quick and easy. Unfortunately, when I tried to run it, it gave me the error about not being able to open the directory mentioned earlier. With a new found sense of patience and curiosity, I decided to research. The X-Deep FAQ mentioned that an earlier version had a tendency to occasionally scramble the registry entries. I opened regedit and poked around a little. I found the X-Deep section mentioned an etc folder. My X-Deep program folder didn't have one - so I created the folder. Now, the application starts up fine, although it tells me that there are no XDM servers available.

Looks like I need to look at the configuration on the server.

Changing the Hostname

I entered the wrong hostname when I setup Linux on the server. It's the same as the desktop machine!

These two pages show how to permanently change the hostname, by editing /etc/sysconfig/network.

Howard's Musings - Changing the Hostname
Mandrake Linux Archives - Changing the Hostname

It worked just fine.

CygwinX

My doc pages asked me to run a program called XWin.exe. I couldn't find it in the Cygwin folders. Then, I read that it is not installed by default. The setup program lists quite a few programs and libraries, and it's difficult to see what is loading or what should load. It is setup for some kind of default install, but it doesn't really say what uses are covered by the default. A neophyte user like myself has no idea what to include.

I went back and found the X11 files and included them in my latest install. I found the XWin.exe file and ran it. Now, I get a message that I'm missing a .dll file. I decided to go back and install every file in the package (which will probably take a week to download).

This program wins the award of:

Comic Book Guy


Worst Installation Program Ever


Wednesday, November 10, 2004

XDM Setup - Step by Step

I'm refering to the pages linked in the earlier post for my instructions. We'll see how it works out.

Edit etc/X11/xdm/xdm-config
put an exclamation mark in front of the line: DisplayManager.requestPort: 0

Edit /etc/X11/xdm/Xaccess
Remove the hash (#) in front of the line: * # any host can get a login window if there is one. (There wasn't)

Edit /etc/X11/gdm/gdm.conf
Find [xdmcp] and change Enable=false to Enable=true.

Whoops! I had to install gdm first.


(3 hours later)

Damn! Is this stuff supposed to be this hard!!!

I downloaded and installed CygwinX (it took forever), but I couldn't make it do what the instruction suggested. More than one source said to open a CygwinX window and enter X -broadcast. Command not found!

Next, I tried X-Deep. It wanted to install to the C: drive (remember, mine's called E:). I redirected the install, but it wouldn't run because it couldn't find the directory.

I'm really missing something here, but I'm too tired to think about it tonight. More tomorrow.



Tips 4 Free

Mandrake Tips Page

XDM

I think I'll start with setting up the X windows system so that I can login to the server via my desktop machine. I've been sharing a monitor between the two, and that's been quite a pain.

Here are some more XDMCP resources:I start tonight. Wish me luck!

Tuesday, November 09, 2004

Finally, It Has Started!

So this evening I began the server project!

I installed Mandrake 10.0 using the nifty graphical install program. I installed most of the packages I will need, including IMAP, NTP, and Samba. It came up just fine. (except I'm not sure about DCHP. It seems to be assigning the same IP address for this machine and the desktop.) I'm using it now to compose this post.

I'm not going to work on it any more tonight, but I'll start work on configuration tomorrow - starting with NTP.

Monday, November 08, 2004

No, and No

Just a quick follow up:

I wasn't able to import my Thunderbird mail settings. Instead, I'm re-entering the various accounts and identities. Not tough to type, but I have to remember it all.

The new drive on the desktop machine is still called E:. I thought about looking into changing it to C:, but that would probably mess up some of the installed software. I'll just leave it that way.

Sunday, November 07, 2004

IDE Card - Day Last

Cartoon of a White FlagWell, I gave up today. I'm anxious to get started on the actual server work, and I'm tired of messing with hardware. I installed the 250GB drive in my desktop machine, and I will soon move the 80GB drive to the server.

The IDE Card goes into my drawer of computer parts. Maybe I'll use it in a later project. Or, I could sell it on eBay.

A weird thing happened when I brought up the new drive. I didn't notice it until I was installing Firefox, and it was asking to install on the E: drive. I had wired the 250GB drive as the master and the 80GB as the slave, but the 80GB retained its old drive letter of C:. The machine boots from E: just fine. (I know - the drive letter is assigned long after boot starts.) I wonder what will happen when I take the 80GB drive out (in about 15 minutes) and reboot. Will the 250GB drive remain at E:, or grab C: once it is not in use? I suppose it isn't a big deal, but it is a little non-standard. I'll read up on the subject.

Once again, I have to install loads of desktop software. For those of you who care, here's the checklist (always being augmented as I remember things):


UPDATE: After I finished writing this post, including adding all of the links, I pressed 'Publish Post' and waited. After the Blogger message indicating a successful upload didn't come up, I decided on a whim to copy the text and paste it into a blank notepad window. Good thing I did, because the Blogger server failed and the text was lost. I would have been quite upset if I had lost it all.

Friday, November 05, 2004

IDE Card - Day 5

I don't think they're trying very hard. Here's the latest from Promise support:

Hi
That is correct, if the ultra133 TX2 work correctly on another system than there is compatible issue with our controller and the Compaq system.

Thank you

Promise Technology Inc

Thursday, November 04, 2004

Linux Partitioning

Someday, if I ever get a drive working in my server, I may want to partition it. This article discusses the subject.

IDE Card - Day 4

The support team at Promise is nothing if not prompt. Here is the next response:

Hi
Some Compaq system bios are proprietary and does not like third party hardware to be added. To confirm if the controller is bad or not do you have another system where you can tested this ultra133 TX2 this way we can tell if the card is bad or not.

Thank you

Picture of DoctorI'll try the board and drive in the new desktop machine. Time for a little surgery!

(10 minutes later)


On the new desktop machine, card and drive work just fine. I see the 232GB drive in Win2K. Darn! So does this mean that the card won't work in the Compaq? I'll write back to support one more time.

I installed the Ultra133 in a different machine, and everything worked just fine. Does this mean that the card isn't compatible with the Compaq? I'm not sure what to try next. Any more advice?

We'll see what they say next.

The Backup Plan

Don't worry. I'm not giving up already.

I am, however, working on an alternate plan to get this server going. Basically, I'm thinking about switching the hard drives. I think the 80GB drive will work in the Compaq without the extra IDE card, and the 250GB drive would be quite happy in the desktop machine.

I'll just keep this in the back of my mind while I continue to work on the IDE card.

Wednesday, November 03, 2004

IDE Card - Day 3

I received the response from the Promise support team yesterday. I appreciate their quick response.

Hi
Have try moving the ultra133 TX2 to different PCI slot. Make sure you have the latest bios and drivers updated for the ultra133 TX2.

Thank you

Promise Technology Inc
Technical Support Lead


I tried both. First, I updated the BIOS on the card to the latest version - 2.20.0.15. No luck.

Next, I removed the LAN card from the only other PCI slot and tried the IDE card there. No luck.

Here's my response back to Promise:

Thanks for answering so quickly. I tried both of the steps you mentioned - update the BIOS (to v 2.20.0.15) and move to the other PCI slot (the machine only has two). Unfortunately, I get the same results. It locks up after displaying IDE Bus Master Enabled.

Are there any issues with Compaq machines from this era, or other incompatibilities I should be aware of? Is it possible that the board is faulty?

I'm open to any suggestions.

Thanks again,

We'll see what they say next.