Linux 1394 FireDisks Installation Guide v1.0 support@unibrain.com [1.Introduction] This small guide will help you use a FireWire compliant external disk under your Linux distribution. It is assumed that you are using a 2.4.18 Linux Kernel or above although it is strongy advised to use the latest one from the 2.4.x series or one from the 2.6.x series. It also assumed that you are using a boot directory called /boot where you keep all your kernel images. You must keep in mind that 1394 support for Linux is not yet very mature and problems might come up during this installation process. [2.Using the external disk without kernel recompiling] 2.4.18 kernels and above have already by default the IEEE 1394 support enabled although some distributions have disabled it. After you install your fireboard and plug the external disk on the bus you can issue the following command and see if all necessary modules have loaded: # lsmod You should be able to see ohci , ieee1394 and sbp2 modules. Even if they are unused at the moment you should be able to see them if you kernel has IEEE 1394 support enabled. If not you will need to go through steps 3 and 4. If you see the modules and you do not want to use the latest IEEE 1394 drivers , although it is strongy advised to do so , - specially if you are using older linux kernels - you can go directly to step 4. [3.Updating the IEEE 1394 drivers] The 2.4.18 Kernel and above already have by default the Firewire 1394 support enabled. You will need to recompile the kernel however in order to use the latest IEEE1394 drivers. In addition you will need to enable the SCSI support , if not already , because the sbp2 driver which will provide you access to your Firewire Disk is simply a SCSI low-level driver which acts like a tunnel. The following ficve easy steps will help you to replace the old drivers with the the latest ones. a. Download the IEEE1394 drivers from the following link: http://www.linux1394.org/download.asp Make sure that you are downloading the one which matches your kernel version. b. Go to your kernel source directory. # cd /usr/src/linux-version If you do not have the kernel source installed please do so or else you can not go any further. c. Now we will need to replace the old drivers with the ones we downloaded from linux1394.org so go to the following directory # cd /usr/src/linux-version/drivers/ # ls You will see that there is a folder called 'ieee1394'. d. Do not delete it , just rename it to something else so you can keep it as a backup # mv ieee1394/ ieee1394.old/ Make sure that you renamed the old folder. e. Unzip the ieee1394 drivers inside the /usr/src/linux-version/drivers/ directory but you will need to move the subfolder which is created inside a folder called branches/ after you extract the files. That means that a folder called 'branches' will be created inside you /usr/src/linux-version/drivers/ directory and inside that folder will be another folder called 'linux-version'. You need to move that directory and name it as 'ieee1394' to your /usr/src/linux-version/drivers root directory. while you are in the drivers directory issue the following command # mv branches/linux-version/ /usr/src/linux-version/drivers/ieee1394 Make sure that you did it correctly. Now we are ready to recompile the kernel. [4.Final Step, Kernel Recompiling] Although it sounds scary after you get used to it it's a fun thing to do and helps you create a much more optimized system. Do the following in order to recompile your kernel a. Go to your /usr/src/linux-version/ directory # cd /usr/src/linux-version b. # make menuconfig c. A menu will appear with all the available modules and options. Go to SCSI support and see if the appears next to where it says SCSI support. If not by pressing the space bar you will be able to activate it. You will also need to add module support to the SCSI Disk support option which is in the same menu. Then exit the SCSI support menu and you will be back to the main menu. d. Now go to the IEEE 1394 (FireWire) support menu and by the use of space modularize the following ( see below ) available options which are in the menu. You should also be able to see the SBP-2 support ( Harddisks etc. ) option. Make sure you add the to that option too. So your menu after you are done adding next to almost everything will look like this: IEEE 1394 ( FireWire) support ( EXPERIMENTAL ) ---Device Drivers Texas Instruments PCILynx Support OHCI-1394 support ---Protocol Drivers OHCI-1394 Video support SBP-2 support ( Hardisks etc.) [ ] Enable Phys DMA support for SBP2 (Debug) Ethernet over 1394 OHCI-DV I/O support Raw IEEE1394 I/O support IEC61883-1 Plug Support IEC61883-6 ( Audio transmission ) support [ ] Excesive debugging output [ ] OUI Database build in Make sure that you have the same options enabled and then exit this menu , exit the main menu and click YES when the system will ask you if you want to save your settings. e. We are now ready to compile the kernel. Just issue the following command and be patient while the kernel compiles…it will take a while! # make dep && make && make clean && make modules && make modules_instal && make bzImage NOTE: make sure that you typed the underscore at the make modules_install command and that bzImage is typed exactly as above because it is case sensitive like everything else in a Linux enviroment. f. after the kernel finished compiling a boot image is created in the /usr/src/linux-version/arch/i386/boot/ directory called 'bzImage' . You need to move that image to your boot directory first. # mv bzImage /boot g. Next you have to rename your original vmlinuz image ( which is the one the system uses ) to vmlinuz-old so you can keep it as backup in case something went wrong and rename the bzImage to vmlinuz in order to use the new kernel. # mv vmlinuz vmlinuz-old # mv bzImage vmlinuz h. This is the final step , we need to edit the lilo.conf in order to tell to the system about the new kernel and to add the old one too in case of an emergency. Edit your lilo.conf with your favourite editor ( pico is used in the following example and it is assumed that your lilo.conf is in your /etc/ directory ). # pico /etc/lilo.conf There is a similar section inside the file: image = /boot/vmlinuz root = /dev/hda9 label = Linux read-only Please note that the above is an example and the root might will probably be different to other systems. After that section you need to add a similar one in order your system to know that you will have two kernels and not only one. So, after you finish adding the new section regarding the image the conf will now look like this: image = /boot/vmlinuz root = /dev/hda9 label = Linux read-only image = /boot/vmlinuz-old root = /dev/hda9 label = Linux-old read-only Now both kernels are added and all you need is to save the changes, exit the editor and issue the following command at the command prompt # lilo If everything was done properly you should see the following output: Added Linux * Added Linux-old If you see any errors about the syntax edit the lilo.conf again and make sure that you wrote everything properly. i. Reboot the system and use the new kernel. [5. Accessing the External Disk] Make sure that the External disk is connected on your Fireboard and it is powered up before you do anything else. If you used the latest IEEE1394 drivers you do not have to worry about hot plugging. If you decided not to update your kernel though you will need to download the following script which you will need to run each time you add a device on the bus. http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh If you have already have formated your external disk you can easily access it like any SCSI device. Make sure first that the modules are loaded so if you type at the command prompt # lsmod You will see a list of the loaded modules. You should be able to see ohci , ieee1394 and sbp2 modules. If not then something went wrong and the modules weren't loaded. The external disk should be at the /proc/scsi/sbp2/ directory. If you have only one device then you can just # cat /proc/scsi/sbp2/0 (or it might be /proc/scsi/sbp2_0/0) in order to see all the related information regarding this device. If you have a second device then it will be the one located at /proc/scsi/sbp2/1 and etc. The partitions of your external disk should be available now. In order to find out which are you can issue the following command # cat /proc/partitions You should be able to see an sda partition or something similar ( general form is sdX for all scsi devices ). You are done, all you have to do is to mount the desired partition now and you will be able to access it normally. If it is an NTFS partition for example you can do the following: Create a directory first which the external devices will be mounted ( you will only need to do this once ) # mkdir /mnt/external and then mount the external device at that directory # mount -t ntfs /dev/sda1 /mnt/external The above is just an example on how to mount an external device, you will need to replace the sda1 with the appropriate partition. In addition your kernel will have to be compiled with NTFS support or else you will not be able to mount an NTFS partition. In order to do that you will need to recompile your kernel ( as described in steps 3 and 4 ).