How To: Budget Network Attached Raid 5 Fileserver, Part 1

I recently came to the conclusion that I need three things.

  1. More Disk Space
  2. Reliable File Backup
  3. Centrally Available File Storage for multiple machines and operating systems

There are multiple solutions to these three problems. Each can easily be tackled separately and there are a ton of good products that do each quite well. But I wanted something that provides all three. With the announcement of Apple’s Time Capsule a NAS or “Network Attached Storage” system suddenly sounded like a great idea. Unluckily Time Capsule does not have a firm ship date, and I’m not sure I wanted to invest in a new Airport Base Station too.

Turning to Google provided hundreds of links to products that were limited to only two hard drives, USB 2.0 only, or didn’t support RAID 5 or higher. Or worse of all did what I wanted but cost way too much. So eying the spare hardware pile, I decided to save some money and build my own NAS server with Raid 5 and Gigabyte network. I figured I’d save several hundred dollars and have a system that was more upgradeable and more reliable.

Tom’s Hardware Guide built one in August 2006. Looking over the list of parts used I wasn’t happy with purchasing a separate SATA RAID card as that would quickly add to the price. It would also significantly add to the complexity of the entire system, and reduce recoverability if the system went down and I had to put the hard drives into another system to recover their data. So a new requirement, Software Raid became quickly apparent.

My Hardware Requirements were pretty basic:

  1. Motherboard
  2. CPU
  3. Memory
  4. 4 Hard Drives for the Raid
  5. 1 Hard Drive for Boot
  6. Case
  7. Power Supply
  8. CDRom (for software install only)

Between various upgrades I was able to scrape together a decent older PC case the boot drive and two of the four drives for the Raid array.

I’m a big fan of the LX-104 case. These were made by a no-name Chinese company for OEM builders. Despite that they were very good construction, thick steel, a working and easy to use snap together design, rounded corners and an attractive $75 retail price. Since their main competitor at the time was first generation Enlight cases this was all pretty attractive. Plus it has two hard drive slots and two 3 1/2 inch bays so that I could install 4 hard drives there.

The original motherboard an Intel PII-233 capable Asus board would have worked well, but then I would have had to go back to a SATA Raid card of some sort. I decided to pick up the Asus M2A-VM board. Not only does it have four on board SATA slots, it had onboard Video and Gigabyte. All of which use fairly common chip sets and are thus supported by Linux and FreeBSD. It also has hardware RAID, but I didn’t want to use that for the reasons outlined above.

I also needed to pick up a new power supply. I’m not an Antec fanatic like a lot of people, but I decided that quite was a definite plus. This machine would be effectively replacing an Apple G5 system which is dead quite. The Antec TP Trio 430w supply looked like it’d do what I need.

Add in two more Western Digital 250gb hard drives, a single chip of DDR2 512mb memory, and a retail Athlon68 3800 cpu at 2.4ghz and I was under $400 total. If I didn’t have some of the other parts on hand the price would have been a lot more making something likeLacie’s Ethernet Disk Raid much more attractive.

Of course, this would also be a great use for that previous generation PC sitting in the closet. With the addition of a couple of extra hard drives it’d be easy to build a budget NAS for under $200.

The boot drive (a 40gb IDE Maxtor) went into a 5 1/4 inch to 3 1/2 inch bay adapter so that it could be master to the boot CD drive. The four SATA drives installed easily, and the entire machine booted perfectly fine.

Next Step: Install Software and Configure

How To: Reset Admin/Root Password

How To: Reset Admin/Root Password

Anyone who has been in the IT business for any length of time knows literally hundreds of passwords. As we get older though it becomes harder and harder to remember each password and continue with safe security practices. Many companies have gone to centralized password systems. But such software is not always compatible with every OS there is. In such cases as the four year old FreeBSD server sitting in the corner that serves one application. So, here is a large list on ways to reset the root password or administrative user on many operating systems. Keep in mind that these instructions all assume you have physical access to the server in question.

FreeBSD (all versions)

  1. Turn Server off. Hitting the Power Button should start a shutdown cycle.
  2. Hit ESC when the OS starts booting
  3. Choose option 4 to boot into Single User Mode
  4. When asked for a shell, hit enter to default to /bin/sh
  5. Once the machine is booted and you see the hash, type
    1. mount -u /
    2. mount -a
  6. Type passwd to reset the password
  7. Enter new password and confirm it. “pam_chauthok(): error in service module” means that the filesystem is not mounted. Follow step 5 again.
  8. Type reboot or hit the power button again to reboot the machine normally.

Linux (Lilo Loader)

  1. Reboot machine
  2. Hit Esc to get to boot prompt if it doesn’t to it automatically
  3. type: linux single
  4. type: passwd
  5. Enter in and confirm new password
  6. type: sync
  7. type: reboot

Linux (GRUB loader)

  1. Reboot machine
  2. Hit Esc to get to boot prompt if it doesn’t to it automatically
  3. Select the Kernal. Hopefully there is only one or two and the names are descriptive. But any one SHOULD work.
  4. type: e
  5. Select the line that starts with “Kernal”
  6. type: e (again)
  7. Add the letter s (in lower case) to the very end of the line
  8. Hit Enter
  9. type the letter b to start booting
  10. Mount the drives type:
    1. mount -t proc proc /proc
    2. mount -o remount,rw /
  11. type: passwd
  12. Enter in new password and confirm it
  13. type: sync
  14. type: reboot

OS X (All Versions) OS X has two ways to reset the Administrator Password.

Option 1:

  1. Find the computer’s original boot disc. These are system specific. If it’s not available, any OS X retail boot disk will work. The wrong disc will give an error message.
  2. Boot off the disc. Accomplish by holding down the c key during power up.
  3. At the Menu go to: Utilities
  4. Choose “Reset Password”
  5. Enter in new password and confirm
  6. Click on Installer
  7. Choose Quit

Option 2:

  1. Hold Down Apple+S while booting computer
  2. Type: sh /etc/rc
  3. Type: passwd root (if that doesn’t work try admin or administrator instead of root)
  4. Enter in new password and confirm
  5. Type: reboot

Solaris (On Sun Hardware)

You must have the Solaris CDRom to do this. If you do not have physical media, get it here. Note that this download is for Ver10, so may not work on older versions.

  1. Reboot Machine
  2. Hit Stop +A to get to the OK prompt
  3. Type: boot cdrom -s
  4. Once booted off the CDRom, type: mount /dev/disk/c0t0d0s0 /a (those are Zeros)
  5. Type: vi /a/etc/shadow
  6. Use the h,j,k,l keys to move around in vi (or go here for more commands)
  7. On the second line, which says root:<bunch of random letters/numbers> type: dd
  8. Type: :wq! to save and quit out of vi
  9. Type: umount /a
  10. Type: boot ok -s (to boot into single user mode)
  11. Type: passwd
  12. Enter in new password and confirm it
  13. Type: reboot

Note that many Solaris systems may have mirrored volumes, a volume manager or other method of copying the full filesystem. If this is the case these instructions will need to be followed for both volumes, otherwise corruption can easily occur.

Solaris (i386/Intel Hardware)

Again you should have the CDRomto boot off of.

  1. Reboot Computer
  2. Enter Bios and Change Boot Order to CDRom first if needed
  3. Boot Computer
  4. On Boot Menu choose Single User mode, which is Option 6 on Solaris 10
  5. Choose Yes when asked to mount the root filesystem
    1. If you choose “No” it can still be mounted with the same command, /dev/disk/c0t0d0s0 /a (those are Zeros)
  6. Type: vi /a/etc/shadow
  7. Use the h,j,k,l keys to move around in vi (or go here for more commands)
  8. On the second line, which says root:<bunch of random letters/numbers> type: dd (to delete whole line)
  9. Type: :wq! to save and quit out of vi
  10. Typ: cd /
  11. Type: umount /a
  12. Type: init s
  13. At password prompt hit enter key
  14. Type: passwd root
  15. Enter in new password and confirm it
  16. Type: reboot

General Windows

Amazingly Windows Server does not have an easy way to recover the password. Microsoft would call this security, but do provide a package of recovery software that does the job. But it costs $199. Tech Trax has an article on reseting the password on XP system via the XP install disc. Or you can download an emergency boot cd from here, here, or buy a password cracker from here. Be extremely careful with downloading Windows password crackers from the Internet. Yes they may work, but it’s more likely they are actually a Virus or a Trojan and could cause more problems then you have already.

*edit* Hiren’s BootCD has several utilities that will allow the reseting of Windows passwords.

Windows 7
This does not reset the password, but allows you to make a new Administrative user who can then change the password in the control panel for the other user.

  1. Boot off your Windows 7 DVD
  2. Choose “Repair your computer”
  3. Go to the recovery environment
  4. Open command prompt
  5. Type “cd windowssystem32”
  6. Type “Rename Utilman.exe Utilman.exe.bak”
  7. Type Copy cmd.exe Utilman.exe
  8. Reboot Computer
  9. At Login Screen, hold down the Windows and “U” keys
  10. Type net user /add NewAccount mypassword (use your own name for NewAccount)
  11. Type net localgroup administrators NewAccount /add (replace NewAccount with the name used above
  12. Login with new user
  13. Go to Start -> Control Panel -> User Accounts and Family Safety
  14. Click on User Accounts
  15. At the bottom of “Make changes to your user account area” click “Manage another account”
  16. Choose old user
  17. Click “Change Password”
  18. Enter the new password
  19. Logout of the current account
  20. Login to the old account with the new password

Windows 8
User the Microsoft Diagnostic and Recovery Tools (download here) to reset the password.

How To: Fix Desktop Switching

How To: Fix Desktop Switching

One of the bugs introduced in Leopard is pretty small, but significant to those of us who highly enjoy our Apple Experience. If Aperture is installed, users are no longer able to change which folder pictures are pulled out of for Desktop Switching. Adding a new folder will show a second, inaccessible “Aperture” folder.

Various troubleshooting steps included removing Aperture, and removing ~/Library/Preferences/com.apple.desktop.plist which is the file that controls the desktop settings. Neither of these worked though.

The fix is pretty simple and amazing really. Open iPhoto. Create a new, blank library. Close iPhoto. Go into Desktop Settings and feel free to add as many folders and you wish. In fact it may already be there if you had  dual Aperture folders before.

After that, simply sit back and enjoy your auto-rotating desktop picture again.

How To: Leopard File Sharing

How To: Leopard File Sharing

Setting up File Sharing in Leopard is incredibly easy to do, but has a couple of gotchas to watch out for.

Step 1 is to open File Sharing under System Preferences. If you’ve setup printer sharing already then this looks familiar.

Step 2, put a check in the box that says “File Sharing”. You will see a list of users who can be “shared” to. From a security standpoint you should have a second, non-admin user setup to share too but that could cause some confusion down the road. On the right side is a list of user permissions, the defaults work pretty well. But if you’re the paranoid type you may want to change “Everyone” to write only, or even “No Access.”

At this point file sharing is good to go between multiple Mac’s only. The machine that you turned this on is going to be the “server”. Connect to it from another machine by going to finder, click on go, then “connect to server”. (Note the shortcut key of Apple-K btw.) simply type in the ip address of the “server” and hit connect. If you do not know the IP address, go into Network Settings under System Preferences to check it.

It’s a good idea to hit the + sign to add the address to your favorites so that you remember it. A password/username box will come up, enter in the credentials of the user you setup in file sharing. This is why you might want to setup a second user just for file sharing, if you have the server locked down for Parental Controls for instance this is the same password to unlock that.

Alas this will not allow Windows users to connect to your Leopard server yet. Go back to File Sharing and hit the “options” button in the lower right hand corner. By default Windows does not know about AFP or Apple File Sharing, so you need to click on SMB. Also take this opportunity to check the box that says “Account” is configured the same way as the previous screen. Simply uncheck the box next to the ones you don’t want to connect, which should be as many as possible.

On the Windows machine click on start then run. Type in (from Network settings on the server) then hit enter. A box will come up with all the shares on the server you can connect too, including printers if that was enabled. Right click on the user folder that was setup earlier and choose “Map Network Drive”. Choose a drive letter, something like h or x works best. Put a check in the box that says “Reconnect at Logon” to have Windows automatically reconnect back to the server every time it’s rebooted. If you’ve got different users with passwords setup, you’ll need to type that user name and password in on the next box.

After that, simply open up “My Computer” and you can drag and drop files to the server, or take them from there. On the server side, keep in mind that files will need to be put into /Users/username/Public folder for any other computer to access them.

One thing to be aware of is that the IP address of the server may change due to DHCP on your router. If the connection fails for any reason, double check the IP address you’re entering. That’s all there is to it, reading through the direction above it looks hard, but it’s actually pretty simple.

Please leave a comment if you have any questions about this.

How To: Save Money on your next computer purchase

How To: Save Money on your next computer purchase

Us computer geeks always looking for ways to save money, especially since a recession is very likely. After all, upgrading to a bigger hard drive or more RAM is an expensive but sometimes very needed upgrade!

Luckily in the 21st century there are plenty of choices when it comes to buying computer hardware and accessories. Online services such as Newegg.com and BestBuy.com are good choice if you do not have a decent local store available. In addition to those though are literally hundreds of retailers who’ve taken advantage of the global economy potential in the Internet. Worse yet, they’re all having sales, rebates, and special offers on a daily basis.

Fear not though, there are plenty of online services to help you track down the best prices in hardware. Some of the best are:

  • http://www.techbargains.com
  • http://www.spoofee.com
  • http://www.hot-deals.org
  • In addition, many forums have good buy/sell/trade sections. These are especially good places to get really good deals, plus you’re usually able to post a want list to find the parts you need. Some good forums are:

  • http://www.arstechnica.com
  • http://www.hardocp.com
  • http://www.nekochan.net (good for obscure parts)
  • http://www.markeedragon.com(good for Game Consoles and gaming hardware)
  • Other resources such as Ebay and your local Craigslist are great choices. But remember, try to hit your local retailer first. Just because we live in a Global Economy, it’s not a reason to stop supporting your friends and neighbors.