Installing unRAID on a full Slackware distro
This procedure is intended to help some with moderate Linux experience set up unRAID on a full Slackware development system.
Of upmost importance was to have a failsafe system, that could be converted back to booting off the standard unRAID USB stick at any time.
This procedure only works for the specifically indicated versions of unRAID.
If you want to install unRAID 5.0x on Slackware, use this article instead.
- 1 Prerequisites and preparation
- 2 Start
- 3 Install Boot Drive and Linux
- 4 Extract initramfs files from bzroot
- 5 Prepare Linux source, and copy unRAID config and source mods
- 6 Copy unRAID config and MD source mods
- 7 Modify the unRAID config
- 8 Build a new Linux kernel
- 9 Copy unRAID scripts and executables
- 10 Test new kernel and drivers with unRAID
- 11 Mount flash and symlink to config
- 12 Final boot
- 13 Some Notes and Issues
Prerequisites and preparation
Changes for unRAID 4.4.2 are highlighted
You need to be able to do the following on your own:
- Install a virgin Slackware 12.1 system (12.2 for unRAID 4.4).
- Set up static IP under Linux.
- Enable Apache and edit the Apache httpd.conf.
- Edit various startup scripts in /etc/rc.d.
- Run menuconfig, select drivers, and rebuild a kernel.
- Debug panics caused by missing drivers in your kernel configuration.
- Use a browser on nonstandard port numbers.
- Edit lilo.conf to create multiple kernel boot options.
If you are doing this on an existing unRAID server, do NOT make any changes (adding or deleting drives) until this process is COMPLETELY done. If something goes fubar, go back to a standard unRAID setup booting from the USB, and get things stable and parity good BEFORE starting this process.
If you are doing this on an existing unRAID server, make sure your unRAID system is stable and parity is good BEFORE starting this process.
- Make a Slackware 12.1 DVD (http://www.slackware.com/getslack/) (Slackware 12.2 with 188.8.131.52 kernel for unRAID 4.4)
- Either use an existing unRAID flash or make a new one. You can make a new unregistered one for install process, and then swap it with your registered one later.
- Boot unRAID from USB and confirm functionality with your mobo, drives, and controllers.
- Save/print a copy of the syslog and dmesg output to help in identifying hardware when you make your own config.
- Save a copy of the output from these commands, to assist you in identifying the hardware in your system:
- lspci -v
- ethtool -i
- If migrating an existing unRAID server:
- Go to "Devices" page of unRAID control panel and PRINT OUT the list of devices.... you will need it later.
Install Boot Drive and Linux
- Shutdown and disconnect all drives and USB sticks you're not using. They can cause problems later.
- Install a DVD drive and one hard drive to be used for Linux and swap, that will NOT be part of the unRAID array.
- Drive should be on primary IDE controller (i.e. /hda). Speed is not critical. Size is not critical, I used a spare 250GB I had laying around, but you can use anything about 20GB and up. A larger drive can be useful as temporary storage for things like nzbget, so your array drives can stay spun down.
- Boot Slackware 12.1 DVD (12.2 for unRAID 4.4)
- cfdisk and create 2GB swap and the rest for Linux. Set the Linux partition to bootable
- Run the Slackware setup, and accept all defaults, except you should enable Apache, and should use a static IP.
- Use a blank password for root. (Note, this will make SSH difficult, so plan to use telnet instead)
- Login as root.
- If you wish to use the GUI, $ startx
- Run hdparm /dev/hda and make sure your drive can run in DMA mode.
- If you want a password on the unRAID management interface and for ssh, set it now. Otherwise make sure root has no password.
- Run pwunconv to remove shadow passwords.
- Make sure you can ping the new server.
- Make sure you can telnet to the new server.
- If not, $ nano /etc/inetd.conf
- Uncomment the Telnet server
- $ kill -HUP 'cat /var/run/inetd.pid' -to start it
- If it says your password is incorrect (and you've checked); $ nano /etc/securetty and remove the '#' for all the pts/X entries
- Open a browser on a PC and browse to your server’s IP and you should see the Apache "It Works" message
- If it doesn't work, you must install Apache, see install instructions here
- Create lilo entry for alternative kernel for recovery if new kernel hangs
- $ ls -la /boot and see what file vmlinuz is linked to (probably vmlinuz-huge-smp-2.6.xx.x-smp)
- $ nano /etc/lilo.conf and duplicate the linux boot section
- Changing the “image=” line to point to to the real file vmlinuz was symlinked to.
- Change the label to unRAID as this is your new image
- It should look something like this:
# Linux bootable partition config begins image = /boot/vmlinuz root = /dev/hdaX label = unRAID read-only image = /boot/vmlinuz-huge-smp-184.108.40.206-smp root = /dev/hdaX label = Linux read-only # Linux bootable partition config ends
15. Save and Exit
16. Run lilo -v
17. Boot back to Slackware, boot alternative kernel entry to make sure it works
Extract initramfs files from bzroot
- Decide where to store a copy of the unRAID distro. I use /unraid
- mkdir /unraid
- cd /unraid
- wget http://download.lime-technology.com/unRAID%20Server%204.3.3.zip, wget http://download.lime-technology.com/unRAID%20Server%204.4.2.zip (for unRAID 4.4)
- unzip *.zip bzroot
- zcat bzroot | cpio -m -i -d -H newc --no-absolute-filenames
- It should read 197274 blocks if it completes correctly.
Prepare Linux source, and copy unRAID config and source mods
- get linux source for 220.127.116.11 and untar it in /usr/src (I've also successfully used 18.104.22.168)
- $ cd /usr/src
- wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-22.214.171.124.tar.bz2, wget http://www.kernel.org/pub/linux/kernel/v2.6/linux-126.96.36.199.tar.bz2 (for unRAID 4.4)
- $ tar -xjf linux-188.8.131.52.tar.bz2 (linux-184.108.40.206.tar.bz2 for unRAID 4.4)
- rename it to linux-220.127.116.11-unraid-special (18.104.22.168 for unRAID 4.4)
- delete (rm linux) the existing linux symlink (if present)
- symlink linux (ln -s linux-22.214.171.124-unraid-special /usr/src/linux) (126.96.36.199 for unRAID 4.4)
- confirm symlink is pointing to the right place (ls -la linux)
Copy unRAID config and MD source mods
- $ cd /usr/src/linux
- $ cp /unraid/usr/src/linux/.config .
- $ cd /usr/src/linux/drivers/md
- $ cp /unraid/usr/src/linux/drivers/md/* .
Modify the unRAID config
This is important. UnRAID uses an initramfs to provide the root file system to the kernel. We are going to use a hard drive for the root file system, so the drivers for Linux to access that drive have to be built into the kernel, and not left as modules.
- run lsmod and lspci and save the output to help you determine which drivers to put in the kernel later.
- $ cd /usr/src/linux
- $ make clean
- $ make oldconfig
- $ make menuconfig
- You have to include (not modularize) drivers for boot disk. My boot disk is IDE.
- Unselect Initial RAM filesystem and RAM disk (initramfs/initrd) support
- Set the following to (*) and not as (M) by using the spacebar to change it:
- File Systems ---> Ext3 journalling file system support and ALL other filesystems on your boot disk, even if you are not mounting them.
- File Systems ---> DOS/FAT/NT Filesystems ---> NTFS file system support for NTFS support. May want to include write support as well.
- Device Drivers ---> ATA/ATAPI/MFM/RLL support (* this first) ---> Enhanced IDE/MFM/RLL disk/cdrom/tape/floppy support
- And Include IDE/ATA-2 DISK support
- And generic/default IDE chipset support
- Save and Exit
You will need to select the necessary drivers for your system. You only need the drivers for the boot drive, not the rest of the unRAID disks. So if the boot drive is IDE, and the unRIAD disks are all SATA, you only need the IDE drivers at this point. You may need to enable something in Serial ATA (prod) and Parallel ATA (experimental) drivers if your boot drive is SATA.
If you have problems here, boot the alternate Linux kernel, and save/print a copy of the syslog and dmesg output for use in identifying hardware.
Build a new Linux kernel
- $ cd /usr/src/linux
- $ make
- $ make modules
- $ make modules_install
- $ make install
- $ reboot into the new kernel
- If it panics, reboot back to the alternate kernel and check the disk drivers. Particularly if the panic was a failure when attempting to mount the root fs.
- Build a new kernel and boot again.
- After your new kernel is booting, log in and run hdparm /dev/hda and make sure your boot drive is in DMA mode. If not, adjust the Linux config until you do.
Once your new kernel is booting and your boot drive is in DMA mode, shut down and congratulate yourself.
Copy unRAID scripts and executables
- I diff’d the unRAID distro to the Slackware distro to see the missing packages. All you really need to copy is these differences to your Slackware distro: eg. $ diff /unraid/root /root to see the differences.
- Plus you need these files (or merge their changes from stock into yours) from /unraid/etc/rc.d:
- Yes, there are some other files with changes, but I found they were not apparently critical to unRAID. You can diff them and see. If anyone finds something else important, be sure to post it.
- If you plan on using user shares, you must also copy the following files (to their respective Slackware directories):
Test new kernel and drivers with unRAID
- Reconfigure your BIOS to boot from hard drive instead of flash.
- Reinstall the unRAID USB stick (either registered or unregistered).
- Boot your new kernel. (Make sure you are not booting from USB... change your BIOS if necessary.)
- Log in and run emhttp -p 88. You should get error message “mkdir: cannot create directory `/boot/config/shares': Not a directory” ignore it for now.
- If you get a segmentation fault, boot into the other kernel
- Open a browser to your server on port 88... should see unRAID control panel. Go to devices, and see if hda is there in the pulldown list.
- Shutdown and add one more drive. Boot back to your new kernel.
- Log in and run emhttp -p 88.
- Open browser to your server on port 88... should see unRAID control panel. Go to devices, and see if both drives are there. Assign the second drive to unRAID, and then start the array.
- Map a drive from unRAID on a PC and test file xfers.
- Shutdown and reboot from UNRAID control panel.
Congrats.... you are in the home stretch.
- If you are upgrading an existing unRAID server and have been using a unregistered flash, now is the time to swap to your registered one.
- Install all your drives.
- Watch your POST messages and see that all hard drives are appearing.
- Reboot and log in as root. Make sure you are booting from the hard drive, and not the flash.
- Mkdir /flash
- Add new line to /etc/fstab: “/dev/disk/by-label/UNRAID /flash vfat defaults 0 0"
- Cd to /boot and remove the symlink for /boot/config.
- Create symlink to /flash/config as /boot/config
- Start emhttp -p 88. You should get no error this time.
- Open browser to your server on port 88... should see unRAID control panel. If you were using a flash with an existing unRAID config, it should have picked it up... if not, it should be empty.
- If you used a flash with an existing unRAID config, some drives may appear missing, but they are probably just in the wrong order. Go back to your printout of the unRAID devices and rearrange them as they were originally.
- Configure your drives for unRAID, and start the array.
- Test the drives by:
- Mapping from another PC and read from each one
- Run hdparm -tT /dev/xxx for each one
- Any problems that show up, probably mean you need to reconfig something in the kernel
- Edit the go script on the flash, to run emhttp with -p 88
- Stop the array and reboot to your system BIOS
- Your system should autoboot from the HD, with the USB flash installed.
- Your go script from the flash should execute, and start emhttp... check syslog or dmesg if it doesn’t start.
- Open browser to your server on port 88... should see unRAID control panel and the configuration changes you just made should have been retained.
- You may need to do a parity check... I didn’t, but YMMV. I did one anyway overnight just to be safe, and no errors were found.
Congratulations. You now have unRAID installed and running on a complete Slackware development system. There is now practically nothing you can not do with this system, in terms of adding software and tweaking configurations.
Some Notes and Issues
If you edit Linux scripts and text files on the PC, be sure to use a text editor that supports Linux line endings. I use notepad2 (http://www.flos-freeware.ch/notepad2.html).
Remove the execute bit from /etc/cron.daily/slocate ... if you don't all your drives will be spun up once a day by slocate.
Edit /etc/rc.d/rc.inet1.conf to change your IP
Edit /etc/resolv.conf and /etc/hosts as needed
Startup mods are usually put in your local startup script (including calling the go script from the flash) (/etc/rc.d/rc.local)
Create a shutdown script (/etc/rc.d/rc.local_shutdown) and put commands to unmount unRAID devices, stop samba, sync, and stop the array.
Note that /etc/samba/smb.shares is rewritten on each boot by unRAID, and it has a bad create mask.
If you are going to mess around with features like S3 suspend, hibernation, installing software like nzbget, or do Linux maintenance stuff, stop the array first. Note you need to unmap all samba drives and in any terminal windows, cd to the root before stopping the array.