Zyxel NSA325: fsck rootfs on boot

This forum is for Marvell Kirkwood devices such as the GoFlex Home/Net, PogoPlug v1/v2, SheevaPlug, and ZyXEL devices.

Zyxel NSA325: fsck rootfs on boot

Postby smaxer » Tue Apr 15, 2014 9:24 am

Hi everyone,

does anybody know a convenient way to run fsck on the root filesystem while booting into arch arm linux?

I had a damaged rootfs and struggled running fsck on it because it was always mounted rw. I ended up booting the NAS into to stock image and run fsck there. But I'd like that fsck runs every startup.

Best,
smax
smaxer
 
Posts: 23
Joined: Sat Jun 15, 2013 9:01 am

Re: Zyxel NSA325: fsck rootfs on boot

Postby moonman » Tue Apr 15, 2014 5:17 pm

The only way is to create uinitrd and modify uboot environment to load it at boot, which i wouldn't recommend unless you have serial
Pogoplug V4 | GoFlex Home | Raspberry Pi 4 4GB | CuBox-i4 Pro | ClearFog | BeagleBone Black | Odroid U2 | Odroid C1 | Odroid XU4
-----------------------------------------------------------------------------------------------------------------------
[armv5] Updated U-Boot | [armv5] NAND Rescue System
moonman
Developer
 
Posts: 3388
Joined: Sat Jan 15, 2011 3:36 am

Re: Zyxel NSA325: fsck rootfs on boot

Postby smaxer » Fri May 23, 2014 8:31 am

Thanks for your answer moonman!

FinIly had some time testing it... haven't built a ramdisk by my self since years so I'm not sure if I'm doing this right:

$this->bbcode_second_pass_code('', '
# cd /boot
# mkinitcpio -g initrd_test.img
# mkimage -A arm -C none -O linux -T ramdisk -d initrd_test.img rootfs.uimg
# reboot

Marvell>> setenv bootargs_linux console=ttyS0,115200 mtdparts=nand_mtd:0x100000(uboot),0x80000(uboot_env),0x80000(key_store),0x80000(info),0xA00000(etc),0xA00000(kernel_1),0x2FC0000(rootfs1),0xA00000(kernel_2),0x2FC0000(rootfs2) root=/dev/sda2 rw rootwait loglevel=8 initrd=/rootfs.uimg
Marvell>> boot
')

The problem is it doesn't work I don't even get an error message - so I'm probably doing something terribly wrong :/

As always any help is appreciated!

Thanks
smax
smaxer
 
Posts: 23
Joined: Sat Jun 15, 2013 9:01 am

Re: Zyxel NSA325: fsck rootfs on boot

Postby WarheadsSE » Fri May 23, 2014 12:26 pm

Mainly? Because that is the kernel command line, and not the arguments for u-boot to load an initrd.

Also, there should be an extraargs, IIRC, that you can use for setting extra bits instead of re-writing the command.

You actually need to alter the `bootm` that is part of the bootcmd_linux. Since you have a serial cable, have a look at `help bootm`
Core Developer
Remember: Arch Linux ARM is entirely community donation supported!
WarheadsSE
Developer
 
Posts: 6807
Joined: Mon Oct 18, 2010 2:12 pm

Re: Zyxel NSA325: fsck rootfs on boot

Postby tomcheng76 » Mon May 26, 2014 7:20 am

This is my goflex net printenv
$this->bbcode_second_pass_code('', 'sata_boot=ide reset; mw 0x800000 0 1; ext2load ide 0:1 0x800000 /boot/uImage; if ext2load ide 0:1 0x1100000 /boot/uInitrd; then bootm 0x800000 0x1100000; else bootm 0x800000; fi')

This is the original? NSA325 printenv
$this->bbcode_second_pass_code('', 'fw_setenv bootcmd_linux 'setenv bootargs $(bootargs_linux); ide reset; ext2load ide 0:1 $(loadaddr) /uImage; bootm $(loadaddr)'')

You should add one for initrd like my goflex net, good luck

ref: http://trweb.cwsurf.de/wordpress_301-de ... ss/?p=2847
tomcheng76
 
Posts: 130
Joined: Mon Dec 13, 2010 11:24 am

Re: Zyxel NSA325: fsck rootfs on boot

Postby smaxer » Tue May 27, 2014 8:01 am

Thanks tomcheng76 and moonman for your help!

I did get it to work with the following settings:

$this->bbcode_second_pass_code('', '
setenv bootcmd_linux 'setenv bootargs $(bootargs_linux); ide reset; ext2load ide 0:1 $(loadaddr) /uImage; ext2load ide 0:1 0x1100000 /rootfs.uimg; bootm $(loadaddr) 0x1100000'
saveenv
')

However without using the if else branch in tomcheng's example. Those commands are probably not implemented in my uboot version...

Thanks again!

Best,
smax
smaxer
 
Posts: 23
Joined: Sat Jun 15, 2013 9:01 am


Return to Marvell Kirkwood

Who is online

Users browsing this forum: No registered users and 9 guests