Adding a Hard Drive to My Ubuntu Samba Server

Since I’ve had more traffic from the Linux and Ubuntu posts than all my other posts, I figured I’ll document my successes here to hopefully help some other poor lost linux souls out.  One of my home projects has been a fast file server for home.  We homeschool, so I wanted a machine where everyone stored their files, so I had one point of backup.  I’ve fought putting up a Windows PDC for years, since that would be WAY overkill for my situation.  I currently have 3 Windows machines, two additional Windows laptop, and my work laptop to content with.  I have already converted one of my DellBuntu systems to my permanent email server using Axigen’s free office email server.  I have an additional DellBuntu that is my foray into the 64-bit Linux world, and I was able to build my SMB server with extra parts from my various leftovers.  All I needed was a case.  My Samba server has proved to be so useful, that I am adding a 500Gb hard drive to it.  Since this is the first time I’ve tried installing an internal hard drive on Linux, I knew I’d run into problems. I’ve installed hundreds of drives on Windows machines, so I knew I could figure it out.
I installed the hard drive… 5 min, no problem.  WD SATA 500gb drive, checked the BIOS on the first boot, and the drive was seen… good start.
With the machine booted, I checked the graphical utilities, and saw that the drive wasn’t auto loaded… so much for dumb luck.  I dropped to a prompt and ran the “df” command and could see the drive on /dev/sdb, which made sense, since I had connected the new drive to the SATA2 port.  Linux will load the drives it finds based upon the SATA port number, so SATA 1 would be sda, SATA 2 sdb, etc.  Next, I checked the disk with a fdisk -l /dev/sdb command.  This showed no partitions, again, what I would expect.  I ran through fdisk, creating one primary partition with all of the drive space.  KISS (keep it simple…).
Next, I ran a mkfs command:  sudo mkfs -t ext3 /dev/sdb
The drive was ready.  I rebooted, just to be safe (too much Windows background here) and when I logged in, the drive was not mounted.  I had to use the Places->Computer function, and then enter my sudo password to get the drive mounted.  This was fine, and I could verify that the drive was working, but I really needed the drive to be loaded and available to all, not just manually to me.
After some research, I found that the fstab file controls the mounting of devices.  So I looked into my /etc/fstab and added a line to accommodate my new drive:
/dev/sdb media/500gb ext3 default 0 0
Rebooted and hung…twice.  After a hard boot, the machine booted, but no drive in sight.  Doing   a little more research lead me to realize that the /media/500gb directory needs to exist, easily fixed.  Reboot.
Now, I’m cooking!  Drive is available and visible.  All that was left was to add a section to my /samba/smb.conf file to add the 500gb drive to my smb shares.  After doing that and restarting samba, I still couldn’t write to the drive from a Windows machine.  Has to be a rights issue.  A quick chmod 777 and everything is working.
I owe my success to Von Hagen’s Ubuntu Linux Bible and the <a href=”http://www.blogger.com/img/gl.link.gif”>Ubuntu Forums</a>, as always.

Since I’ve had more traffic from the Linux and Ubuntu posts than all my other posts, I figured I’ll document my successes here to hopefully help some other poor lost linux souls out.  One of my home projects has been a fast file server for home.  We homeschool, so I wanted a machine where everyone stored their files, so I had one point of backup.  I’ve fought putting up a Windows PDC for years, since that would be WAY overkill for my situation.  I currently have 3 Windows machines, two additional Windows laptop, and my work laptop to content with.  I have already converted one of my DellBuntu systems to my permanent email server using Axigen’s free office email server.  I have an additional DellBuntu that is my foray into the 64-bit Linux world, and I was able to build my SMB server with extra parts from my various leftovers.  All I needed was a case.  My Samba server has proved to be so useful, that I am adding a 500Gb hard drive to it.  Since this is the first time I’ve tried installing an internal hard drive on Linux, I knew I’d run into problems. I’ve installed hundreds of drives on Windows machines, so I knew I could figure it out.
I installed the hard drive… 5 min, no problem.  WD SATA 500gb drive, checked the BIOS on the first boot, and the drive was seen… good start.
With the machine booted, I checked the graphical utilities, and saw that the drive wasn’t auto loaded… so much for dumb luck.  I dropped to a prompt and ran the “df” command and could see the drive on /dev/sdb, which made sense, since I had connected the new drive to the SATA2 port.  Linux will load the drives it finds based upon the SATA port number, so SATA 1 would be sda, SATA 2 sdb, etc.  Next, I checked the disk with a fdisk -l /dev/sdb command.  This showed no partitions, again, what I would expect.  I ran through fdisk, creating one primary partition with all of the drive space.  KISS (keep it simple…).
Next, I ran a mkfs command:  sudo mkfs -t ext3 /dev/sdb
The drive was ready.  I rebooted, just to be safe (too much Windows background here) and when I logged in, the drive was not mounted.  I had to use the Places->Computer function, and then enter my sudo password to get the drive mounted.  This was fine, and I could verify that the drive was working, but I really needed the drive to be loaded and available to all, not just manually to me.
After some research, I found that the fstab file controls the mounting of devices.  So I looked into my /etc/fstab and added a line to accommodate my new drive:  /dev/sdb media/500gb ext3 default 0 0
Rebooted and hung…twice.  After a hard boot, the machine booted, but no drive in sight.  Doing   a little more research lead me to realize that the /media/500gb directory needs to exist, easily fixed.  Reboot.
Now, I’m cooking!  Drive is available and visible.  All that was left was to add a section to my /samba/smb.conf file to add the 500gb drive to my smb shares.  After doing that and restarting samba, I still couldn’t write to the drive from a Windows machine.  Has to be a rights issue.  A quick chmod 777 and everything is working.
I owe my success to Von Hagen’s Ubuntu Linux Bible and the <a href=”http://www.blogger.com/img/gl.link.gif”>Ubuntu Forums</a>, as always.

Advertisement

Tags: , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.