1. Failsafe mode

If you forgot your password, broke one of the startup scripts, firewalled yourself or corrupted the JFFS2 partition, you can get back to a cleaned state by using my kernel failsafe mode.

1.1 Prepare a USB-PEN with Openwrt

You need a usb stick with at least 16MB size (I use 4GB…) Use your work PC to create the fall-back system.

download the root filesystem from http://opengemini.free.fr/openwrt/trunk/cs351x/

Planex openwrt-cs351x-mzknas-rootfs.tar.gz
Mvixusa openwrt-cs351x-mvixbox-rootfs.tar.gz

1.1.1 Linux

As root user, plug the usb pen and find out the device (let's say enumerated as sdd)
Partition the sdd device in order to have a first linux partition sdd1 and format it as ext3

mkfs.ext3 /dev/sdd1

Let the system mount it as for example /media/myusbpen Copy the root file system over the usb pen and eject it

tar xzf -C /media/myusbpen/  openwrt-cs351x-mvixbox-rootfs.tar.gz

1.1.2 Windows

no instructions yet

1.2 Boot into failsafe mode

Unplug the NAS's power cord.
Remove your hard disks if any
Plug your usb pen in any of the usb ports
Power up your NAS, Press any of the buttons until you hear three bips of for 30 seconds
Openwrt should be up and running from ip 192.168.1.250, proceed to a firmware upgrade (be sure to uncheck “Keep configuration files”)

2. Alternate root file system

You might need more space to install all your additional packages or hacks which would run your flash out of space.

Here is the procedure to mount a partition of an external USB pen or an internal hard disk as a system partition from which openwrt will operate

Let's assume that your target partition is /dev/sdb1 that you already formated and is empty, for example:

fdisk /dev/sdb
mkfs.ext2 -L mzkroot /dev/sdb1

2.1 Clone OpenWRT

use instructions as per 1.1 in order to get a system on a usb pen or hard disk, then plug it into your NAS for the next steps

2.2 Adjust your fstab

2.2.1 Command line way

/etc/config/fstab

config mount
        option 'device'        '/dev/sdb1'
        option 'fstype'        'ext2'
        option 'options'       'rw,noatime'
        option 'enabled'       '1'
        option 'enabled_fsck'  '0'
        option 'is_rootfs'     '1'

Because your mount point might move upon other USB pen or hard disks in your system, I advise you to make the system detect your root partition by LABEL or UUID

to give your device a LABEL (mzkroot in my example), unmount your device and run

tune2fs -L mzkroot /dev/sdb1

you can always grab your current labels and uuids with the blkid command:

blkid
/dev/sdb1: LABEL="mzkroot" UUID="1b7854a2-e189-4148-a044-ecfe718897f8"
/dev/sda2: UUID="ed33171e-f37b-4938-a37b-c775d69d9aac"
/dev/sda1: UUID="64ae4c8b-8ff7-4757-ac10-fcbe24147516"

Add then add the option UUID or LABEL to the fstab/config/mount which take precedence over the option device /dev/sdb1 :

option 'label' 'mzkroot'

or

option 'uuid' '1b7854a2-e189-4148-a044-ecfe718897f9'

if for some reason your external device gets mounted but disabled as rootfs, force the system to recalculate the md5sum at next boot

root@NAS:/# mount
/dev/sdb1 on /tmp/overlay-disabled type ext2 (rw,noatime,errors=continue)
rm /tmp/overlay-disabled/etc/extroot.md5sum
reboot

2.2.3 GUI Way

The laziests might prefer adjusting the fstab through the GUI

 
Back to top
openwrt_failsafe.txt · Last modified: 2012/03/02 23:12 (external edit)
 
 
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0