[nas-2000] for experts only: swapping to debian linux on NAS 1000

  • From: Felix Mellmann <mellmispam@xxxxxx>
  • To: nas-2000@xxxxxxxxxxxxx
  • Date: Wed, 21 Nov 2007 18:18:56 +0100

hello guys,

my NAS 1000 runs debian linux directly from disk. Flip asked me to write how to do this.

Please note, that modifying the flash contents and anything on the hdd can lead in unexpected results. Everything that follows should only be done by experts. If you cannot understand one single step I describe then forget about having Debian on your NAS.
I warned you.

What you need to have:
- a RaidSonic NAS 1000 (NAS 2000 is untested!) with Firmware 2.x and above
- every single flash image of the original firmware (don't blame me, if you are unable to restore the previous system) - a serial connection from NAS to your PC (you really need it!) and a little bit experience with terminal emulation programs (Hyper Terminal, minicom)
- a functional network connection
- a tftp server which has been set up
- maybe an unused hard disk that you will use instead of your big hard disk, this will avoid that you loose any data

(1) Create a partitioning schema (use the hdd via usb mode):
- /dev/hda1 as ext2/ext3 (whatever you like, ext3 cannot be used, when you like to spin down the hdd for energy saving reasons) and at least 200 mb (1,5 gb recommended)
- /dev/hda2 as an extended partition, may fill the rest of the disk
- /dev/hda5 as a logical ext2/ext3/xfs, leaving about 600 mb at the end of the disk
- /dev/hda6 as a logical swap partition

- do mkfs.ext2/mkfs.ext3 on the newly created primary partition
- do tune2fs -i 0 on that partition (the nas hasn't got a battery powered real time clock, so fsck will run on every boot up)
- do mkswap on the swap partition
- check whether /sbin/restore is installed, if not, install dump
- download the prepared debian image from
- mount the primary partition to /mnt
- cd /mnt
- restore that image: restore -rf >image-file<
- in the folder initrd_image is a file initrd.gz, copy this to your tftp root directory

now you have a basic debian etch image on your nas hdd

(2) replacing the initrd-image in flash
- set up the serial connection
- start a terminal emulation program (19200,8,n,1)
- power on the nas in network mode
- as soon as the message appears telling you to press ^C, press CTRL+C
- 2 and enter (List images)
- 4 and enter (Create New Image) (I don't know if it's required to delete the images before uploading a new one)
- Image Name: Ramdisk
- Flash Address: 0x701A0000
- Memory Address: 0x00800000
- Entry Point: 0x00800000
- An image named 'Ramdisk' exists - continue (y/n)? y
- 2 and enter (Download by TFTP)
- TFTP Server IP Address: <the address of your tftp server>
- Image Path and name: <full path to the initrd.gz file>
- Waiting to receive file ....
- 1 and enter

now the debian system should boot up (hopefully)

(3) completing the installation
- the root user has the password root (isn't that clever?!), so change the password - you should create new ssh-server host keys, delete them from /etc/ssh and do
a dpkg-reconfigure openssh-server (this will take some more time ...)
- create the filesystem for your data and activate it in /etc/fstab (don't forget to tune2fs -i 0 on that partition)
- edit /etc/samba/smb.conf to your needs, edit /etc/exports
- add your users
- may be change the locale from de_DE to your language ...
- "apt install" whatever you want
- hmm, ask if you have any further questions

(4) missing things
- till now, the power button is a no-go!, because pressing this button will switch of the nas after some seconds without shutting down the system (slogin root@nas halt will do the job remotely)
- installer (... nice joke ...)
- the sources of the modified /sbin/init (the current image includes the sysvinit version of debian sarge, I think rewriting the patch for etch would be appreciated)


Other related posts: