Emergency Boot

From NAS-Central Buffalo - The Linkstation Wiki
Jump to: navigation, search


This section shows how to create your own "emergency boot" partition. So even if your system has completely crashed, you could run it.


You need the Fail Safe Firmware and a memory stick / usb drive.

here we go

1. Have a clean usb partition and partition it (mfdisk -c /dev/sda) as sda1 (the first usb you put into your terastation is sda). It should have about 371MB. Format it xfs or ext2. Touch the file INIT-SYSBACKUP and reboot. (!!: if it is drive, it is automounted to /mnt/usbdisk1, if it is a stick it is not automounted - I used a stick)

TERASTATION login: myroot
root@TERASTATION:~# mkfs.xfs -f /dev/sda1
meta-data=/dev/sda1              isize=256    agcount=8, agsize=31812 blks
         =                       sectsz=512  
data     =                       bsize=4096   blocks=254490, imaxpct=25
         =                       sunit=0      swidth=0 blks, unwritten=1
naming   =version 2              bsize=4096  
log      =internal log           bsize=4096   blocks=1200, version=1
         =                       sectsz=512   sunit=0 blks
realtime =none                   extsz=65536  blocks=0, rtextents=0
root@TERASTATION:~# mkdir /mnt/sda1
root@TERASTATION:~# mount /dev/sda1 /mnt/sda1
root@TERASTATION:~# touch /mnt/sda1/INIT-SYSBACKUP
root@TERASTATION:~# reboot

2. After booting your system has been copied to your stick. If you touch the file /etc/HD-HTGL-EM, then your system is booted from sda1, bypassing other checks. To have Complete Functionality , some other corrections are neccessary. (See below)

TERASTATION login: myroot
root@TERASTATION:~# mount /dev/sda1 /mnt/sda1
root@TERASTATION:~# cd /mnt/sda1
root@TERASTATION:/mnt/sda1# touch etc/HD-HTGL-EM
root@TERASTATION:/mnt/sda1# vi etc/fstab

# /etc/fstab: static file system information.
# <file system> <mount point>   <type>  <options>               <dump>  <pass>
/dev/sda1        /              auto    defaults,noatime                0 0
/dev/md0        /mnt/teraroot   auto    defaults,ro                     0 0
proc            /proc           proc    defaults                        0 0
/dev/hda2       swap            swap    defaults                        0 0
/dev/hdc2       swap            swap    defaults                        0 0
/dev/hde2       swap            swap    defaults                        0 0
/dev/hdg2       swap            swap    defaults                        0 0

root@TERASTATION:/mnt/sda1# mkdir mnt/teraroot
root@TERASTATION:~# reboot

3. After you reboot your system, it boots from stick.

TERASTATION login: myroot
root@TERASTATION:~# mount
/dev/sda1 on / type auto (rw,noatime)
proc on /proc type proc (rw)
/dev/shm on /mnt/ram type tmpfs (rw,mode=1777,size=15m)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/md0 on /mnt/teraroot type xfs (ro)
/dev/md1 on /mnt/array1 type xfs (rw,noatime)
/dev/md2 on /mnt/array2 type xfs (rw,noatime)
/proc/bus/usb on /proc/bus/usb type usbdevfs (rw)

Do not worry, if the power led blinks yellow after booting, this is intended.

Complete Functionality

To have terastation check your disks (and blinking nicely with red LEDs if a disk fails), following conditions must be met:

  1. the system partion /dev/md0 must be
    1. built from /dev/hda1 /dev/hdc1 /dev/hde1 /dev/hdg1
    2. up and
    3. mounted (no matter where)
  2. the data partitions, e.g. raid1 /dev/md1 /dev/md2 must also be
    1. built from their intended partitions hd'x'3
    2. up and
    3. mounted

The system can be run from a different location. You e.g. could use the last partition hd'x'4, which is probably used as a 'safety margin' to build /dev/md3.

How-to courtesy of André [1]