DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2008-07-20 19:38:30

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Updated Filesystem Check Tools

I've updated my filesystem check tools at http://inreto.de/dns323/fsck

It's a small Linux that runs completely in RAM, so that the disks can be safely checked. It includes the latest ext2 filesystem tools (e2fsprogs-1.41.0), GNU parted (parted-1.8.8, http://www.gnu.org/software/parted/ ) and the RAID admin tool mdadm (2.6.7). The kernel (Linux 2.6.25.1) also includes USB-storage support, so you can check USB disks.

The old version of the tools are still available at http://www.inreto.de/dns323/fsck.2007/

Offline

 

#2 2008-07-20 22:23:00

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Updated Filesystem Check Tools

Hi Fonz,

It is a great ida but it did not work for me on /mnt/HD_a2/fsck. The fsck instals fine, executes OK but still no telnet access after 5 minutes.....
DNS-323 can be shut down from the front panel and after restart the old system is back.

SD

Last edited by skydreamer (2008-07-20 22:23:31)

Offline

 

#3 2008-07-21 00:48:35

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

skydreamer wrote:

... still no telnet access after 5 minutes.....
DNS-323 can be shut down from the front panel and after restart the old system is back.

Just tried it (using /mnt/HD_a2) and it's working fine here.

It's strange that the button is still working. I've attached a modified version of the reload script. It won't detach, so you should see what's going on and where it fails. Could you try it and post output here?


Attachments:
Attachment Icon debug-reload.sh, Size: 1,620 bytes, Downloads: 802

Offline

 

#4 2008-07-21 02:21:15

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Updated Filesystem Check Tools

/mnt/HD_a2/fsck # ls -l
-rw-r--r--    1 1000     1000         2314 Jul 20 15:53 README.txt
-rwxr-xr-x    1 nobody   501          1620 Jul 21 00:17 debug-reload.sh
-rw-r--r--    1 1000     1000      2595046 Jul 20 15:31 fsck-initramfs.gz
lrwxrwxrwx    1 1000     1000           17 Jul 20 19:14 initramfs.gz -> fsck-initramfs.gz
-rwxr-xr-x    1 1000     1000         1606 Jul 20 15:44 reload.sh
-rw-r--r--    1 1000     1000        16746 Jul 13 14:50 reloaded-2.6.12.6-arm1-fonz.ko
-rw-r--r--    1 1000     1000        16746 Jul 13 14:50 reloaded-2.6.12.6-arm1.ko
-rw-r--r--    1 1000     1000        16427 Jul 13 14:50 reloaded-2.6.6-arm2.ko
lrwxrwxrwx    1 1000     1000           15 Jul 20 19:14 zImage -> zImage-2.6.25.1
-rw-r--r--    1 1000     1000      1974476 Jul 20 14:37 zImage-2.6.25.1
/mnt/HD_a2/fsck # ./debug-reload.sh
+ sync
+ mount -o remount -r /mnt/HD_a2
mount: mounting /dev/md0 on /mnt/HD_a2 failed: Device or resource busy
+ mount -o remount -r /mnt/HD_a4
+ mount -o remount -r /mnt/HD_b4
+ mount -o remount -r -a
mount: mounting rootfs on / failed: Invalid argument
mount: mounting /dev/root on / failed: No such file or directory
+ mount
rootfs on / type rootfs (rw)
/dev/root on / type ext2 (rw)
proc on /proc type proc (rw,nodiratime)
/dev/loop0 on /sys/crfs type cramfs (ro)
/dev/md0 on /mnt/HD_a2 type ext2 (rw)
/dev/sda4 on /mnt/HD_a4 type ext2 (ro)
/dev/sdb4 on /mnt/HD_b4 type ext2 (ro)
none on /proc/bus/usb type usbfs (rw)
devpts on /dev/pts type devpts (rw)
/dev/md0 on /opt type ext2 (rw)
+ sync
+ sleep 1
+ insmod /mnt/HD_a2/fsck/reloaded-2.6.12.6-arm1.ko machtype=1542 kernel=/mnt/HD_a2/fsck/zImage-2.6.25.1 initrd=/mnt/HD_a2/fsck/fsck-initramfs.gz cmdline=console=ttyS0,115200 ip=192.168.111.61::192.168.111.254:255.255.255.0:jumbo:eth0:none

Offline

 

#5 2008-07-21 02:27:45

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Updated Filesystem Check Tools

root@jumbo:~# ps -A
PID   USER     COMMAND
    1 root     init 
    2 root     [kthreadd]
    3 root     [ksoftirqd/0]
    4 root     [events/0]
    5 root     [khelper]
    6 root     [kblockd/0]
    7 root     [ata/0]
    8 root     [ata_aux]
    9 root     [khubd]
   10 root     [pdflush]
   11 root     [pdflush]
   12 root     [kswapd0]
   13 root     [aio/0]
   14 root     [scsi_eh_0]
   15 root     [scsi_eh_1]
   16 root     [scsi_eh_2]
   17 root     [scsi_eh_3]
   18 root     [mtdblockd]
   19 root     [ftld]
   20 root     [nftld]
   21 root     [rpciod/0]
   52 root     /ffp/sbin/syslogd
   62 root     /ffp/sbin/klogd -c 3
   73 root     /ffp/sbin/telnetd
   74 root     /ffp/sbin/getty -L ttyS0 115200 vt100
   75 root     -sh
   76 root     ps -A
root@jumbo:~# df
Filesystem           1k-blocks      Used Available Use% Mounted on
tmpfs                    30488         0     30488   0% /dev

It works with your modified script- I have broken the telnet connection and managed to reconnect again. The button is finally dead.

Offline

 

#6 2008-07-21 09:54:46

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

skydreamer wrote:

It works with your modified script- I have broken the telnet connection and managed to reconnect again. The button is finally dead.

That's good news.

I think the shell is the problem. On my box /ffp/bin/sh was a link to bash. After changing it back to busybox, it stopped working like yours. For the moment, you should be able to run the original script (which I highly recommend, because it properly cleans up before booting) with

Code:

bash ./reload.sh

Offline

 

#7 2008-07-21 12:41:39

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Updated Filesystem Check Tools

Thanks Fonz but where is bash? (ffp 0.5)

/mnt/HD_a2/fsck # bash ./reload.sh
/ffp/bin/sh: bash: not foun

Offline

 

#8 2008-07-21 12:54:33

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

skydreamer wrote:

Thanks Fonz but where is bash? (ffp 0.5)

Come on, packages are at http://www.inreto.de/dns323/fun-plug/0.5/packages/

Code:

cd /some/temp/dir
wget http://www.inreto.de/dns323/fun-plug/0.5/packages/bash-3.2-3.tgz
funpkg -i bash-3.2-3.tgz

Offline

 

#9 2008-07-21 15:13:05

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: Updated Filesystem Check Tools

I just tried it on my CH3SNAS, but when issuing the "free" command, there's no space reserved for swap. The complete line shows only zeros.
Also, when typing "mount", none of my hard drives show up. Shouldn't they be listed as ro, anyway?

Offline

 

#10 2008-07-21 15:22:14

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

KyleK wrote:

I just tried it on my CH3SNAS, but when issuing the "free" command, there's no space reserved for swap. The complete line shows only zeros.
Also, when typing "mount", none of my hard drives show up. Shouldn't they be listed as ro, anyway?

Glad it's booting on a CH3SNAS, too.

What's the swap paritions on a CH3SNAS? fdisk -l should show.

On my DNS-323, it's:

Code:

root@bob:~# fdisk -l | grep swap
/dev/sda1               1          66      530113+ 82 Linux swap

After you found out, you can activate it manually with:

Code:

swapon /dev/sda1

KyleK wrote:

Also, when typing "mount", none of my hard drives show up. Shouldn't they be listed as ro, anyway?

No disks are mounted, not even ro. But it's simple enough to do: mount -r /dev/sda2 /mnt (-r for read-only)

I don't think it's a good idea to have them mounted, even ro. Although an ro-mount can't cause damage, e2fsck might change stuff on disk, making the filesystem caches inconsistent.

Offline

 

#11 2008-07-21 15:38:07

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: Updated Filesystem Check Tools

when booting to the normal funplug-0.5, "fdisk -l" does show me the swap partitions (one on each of the 2 drives).
But after using the reload.sh script and logging back into the CH3SNAS via telnet, "fdisk -l" has no output at all.
Looking at /dev, there are no sd* devices listed whatsoever.

Any idea why that might be?

Regarding the mounting:

I assumed the drives would be listed when issuing the "mount" command since the reload.sh script speaks of "remount file systems as read-only". It does indeed make sense that they're not mounted, since they ought to be checked for errors :)

Offline

 

#12 2008-07-21 16:06:53

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

KyleK wrote:

But after using the reload.sh script and logging back into the CH3SNAS via telnet, "fdisk -l" has no output at all.
Looking at /dev, there are no sd* devices listed whatsoever.

I get the normal output:

Code:

root@bob:/sys# uname -a 
Linux bob 2.6.25.1-ffp #1 Sun Jul 20 15:37:41 CEST 2008 armv5tel unknown
root@bob:/sys# fdisk -l | grep swap
/dev/sda1               1          66      530113+ 82 Linux swap

Maybe the kernel doesn't detect the CH3SNAS SATA controller?
The DNS-323 rev A1 is a DB88F5181 SoC, I think the DNS-323 rev B1 and CH3SNAS have a different (but mostly compatible) SoC:
http://dns323.kood.org/forum/p5797-2007 … html#p5797

Can you post your output of (with Linux 2.6.25.1 running):

Code:

root@bob:~# dmesg | grep -i mv
CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a0053177
Orion ID: MV88F5181-Rev-B1. TCLK=166666667.
MV-643xx 10/100/1000 Ethernet Driver
sata_mv 0000:00:01.0: version 1.20
sata_mv 0000:00:01.0: Applying 60X1C0 workarounds to unknown rev
sata_mv 0000:00:01.0: Gen-IIE 32 slots 4 ports SCSI mode IRQ via INTx
scsi0 : sata_mv
scsi1 : sata_mv
scsi2 : sata_mv
scsi3 : sata_mv

KyleK wrote:

I assumed the drives would be listed when issuing the "mount" command since the reload.sh script speaks of "remount file systems as read-only".

Purpose of reload.sh is to shutdown the current system, and then initiate the reboot. remounting filesystems read-only is part of the shutdown. The 'insmod' at the end triggers the reboot and does not not return, so the last line won't ever be executed if all goes well.

Offline

 

#13 2008-07-21 16:38:34

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: Updated Filesystem Check Tools

Apparently, no SATA hardware is detected by the kernel:

Code:

CPU: Feroceon [41069260] revision 0 (ARMv5TEJ), cr=a0053177
Orion ID: MV88F5182-A2. TCLK=166666667.
MV-643xx 10/100/1000 Ethernet Driver

I've attached the complete dmesg output, maybe it's of help to you.


Attachments:
Attachment Icon dmesg.log, Size: 6,140 bytes, Downloads: 438

Offline

 

#14 2008-07-21 17:47:43

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

KyleK wrote:

I've attached the complete dmesg output, maybe it's of help to you.

Thanks. I found a recent commit in the orion kernel git tree that looks relevant:
http://git.kernel.org/?p=linux/kernel/g … 25a563f8db

I'll have a look and try to build a new kernel. For now, CH3SNAS won't work.

Offline

 

#15 2008-07-22 00:17:30

skydreamer
Member
From: At the Atlantic Coast
Registered: 2007-01-06
Posts: 232

Re: Updated Filesystem Check Tools

fonz wrote:

Come on, packages are at http://www.inreto.de/dns323/fun-plug/0.5/packages/

Oh, silly me, I thought I am missing a shortcut rather than a package! It works great and I believe that it is THE way to go with fsck rather than modified fun_plug.

Thanks,

SD

PS: fsck on 75% full 1TB RAID1 takes easily 30 minutes....

Offline

 

#16 2008-07-22 04:05:27

rcblackwell
Member
From: Pickering, ON
Registered: 2008-05-19
Posts: 204
Website

Re: Updated Filesystem Check Tools

fonz wrote:

I've updated my filesystem check tools at http://inreto.de/dns323/fsck

fonz,

Following your excellent instruction bash and the latest fsck tool were installed and run. From what I understand of Linux (I'm still new at this!) and the messages that displayed during the operation, all worked well. I do have a couple of questions though;

1) Executing uname returns "Linux DNS323_NAS 2.6.25.1-ffp #1 Sun Jul 20 15:37:41 CEST 2008 armv5tel unknown". This is not what the README.txt indicates I'll see. Is the "unknown" part okay?

2) Executing e2fsck /dev/sda2 returns

Code:

 /dev/sda2: clean, 13321/38944768 files, 11556902/77881111 blocks

Can I assume the word "clean" in this statement means everything on sda2 is great?

3) Upon reboot dmesg showed the following;

Code:

RAMDISK: Compressed image found at block 0
usb 1-1: new high speed USB device using ehci_platform and address 2
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.2: new full speed USB device using ehci_platform and address 3
usb 1-1.4: new high speed USB device using ehci_platform and address 4
EXT2-fs warning: maximal mount count reached, running e2fsck is recommended

What does the warning on the last line mean?

Output from dmesg is attached for reference.

Bob Blackwell
Pickering, ON

Last edited by rcblackwell (2008-07-22 04:08:49)


Attachments:
Attachment Icon dmesg.txt, Size: 7,427 bytes, Downloads: 940

Bob Blackwell
Pickering, ON

Offline

 

#17 2008-07-22 11:22:00

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

rcblackwell wrote:

1) Executing uname returns "Linux DNS323_NAS 2.6.25.1-ffp #1 Sun Jul 20 15:37:41 CEST 2008 armv5tel unknown". This is not what the README.txt indicates I'll see. Is the "unknown" part okay?

Yes, that's perfectly fine. 'uname -a' shows a little extra info, I've quoted only the version '2.6.25.1-ffp'.

rcblackwell wrote:

2) Executing e2fsck /dev/sda2 returns

Code:

 /dev/sda2: clean, 13321/38944768 files, 11556902/77881111 blocks

Can I assume the word "clean" in this statement means everything on sda2 is great?

It didn't even check. By default, e2fsck will only check filesystems that haven't been shut down properly, or have been mounted 'often' since the last check ('maximal mount count reached' message). If you want to force a check, you can run 'e2fsck -f /dev/sda2'.

rcblackwell wrote:

Code:

RAMDISK: Compressed image found at block 0
...
EXT2-fs warning: maximal mount count reached, running e2fsck is recommended

Nothing to worry about. 'ramdisk' relates to the firmware filesystem. It's stored on flash and loaded to ram (into a ramdisk) on every boot. It can't take damage.

Offline

 

#18 2008-07-23 09:43:39

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

KyleK wrote:

Apparently, no SATA hardware is detected by the kernel

I've uploaded a new kernel: linux-2.6_orion
This is the current development kernel. To use it, download the updated files, relink zImage, and boot:

Code:

cd /ffp
rsync -av --delete inreto.de::dns323/fsck .

cd fsck
rm zImage
ln -s zImage-2.6_orion zImage

./reload.sh

Please repeat the dmesg | grep mv step first. If it now detects the sata controller, do a read-only mount first and see if the files look ok.

Offline

 

#19 2008-07-23 20:24:37

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: Updated Filesystem Check Tools

Unfortunately, with the orion 2.6 image, I'm not able to log in anymore via telnet. PuTTY tries to connect but closes after a couple of seconds.
Using the "old" 2.6.25.1 kernel, telnet works, but as before the SATA controller isn't recognized.

Offline

 

#20 2008-07-23 21:15:38

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

KyleK wrote:

Unfortunately, with the orion 2.6 image, I'm not able to log in anymore via telnet. PuTTY tries to connect but closes after a couple of seconds.

You did also fetch the new fsck-initramfs.gz, didn't you? On my dns-323, the orion kernel doesn't acticate the nic properly, too. I had to modify the initramfs to 'reactivate' eth0.

Offline

 

#21 2008-07-23 22:05:41

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: Updated Filesystem Check Tools

I did update via your rsync command, I assumed it would fetch all the necessary files?

Offline

 

#22 2008-07-26 00:34:18

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

KyleK wrote:

I did update via your rsync command, I assumed it would fetch all the necessary files?

Yes, sure. Please update again. There's another obvious option: use plain old 2.6.12.6.
I've added the 2.6.12.6 to the directory and made it the default for now. Since nobody complained about the 2007 version of fsck, I think that kernel will work for you, too.

Offline

 

#23 2008-08-02 12:31:47

KyleK
Member
From: Dresden, Germany
Registered: 2007-12-05
Posts: 1178

Re: Updated Filesystem Check Tools

Sorry for not replying for a while, I was busy with other stuff.

Yes, with the new (old) kernel it works as advertised, checking right now.
One thing I noticed though: I can't access fanspeed or temperature, as the directory /sys/class/i2c-adapter/ is empty (there's no i2c-0).
Not that much of a big deal, but with the hot weather these days, one should do the tests at night :)

Thanks for this tool!

Offline

 

#24 2008-08-02 13:10:02

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: Updated Filesystem Check Tools

KyleK wrote:

One thing I noticed though: I can't access fanspeed or temperature, as the directory /sys/class/i2c-adapter/ is empty (there's no i2c-0).

Only present in vanilla kernels. 2.6.12.6 is the D-Link kernel with a (strange) different interface for fancontrol. The tools needed for the old kernel are not yet included in the ramdisk...

Offline

 

#25 2008-08-03 20:36:29

unmesh
Member
Registered: 2008-03-26
Posts: 55

Re: Updated Filesystem Check Tools

I'm not much of a *nix geek but was able to follow the instructions above and reboot. However, both of my drives (mounted as separate volumes) show the following when trying to run e2fsck

root@DLINK:~# uname -r
2.6.12.6-arm1_huge
root@DLINK:~# e2fsck /dev/sda
e2fsck 1.41.0 (10-Jul-2008)
e2fsck: Device or resource busy while trying to open /dev/sda
Filesystem mounted or opened exclusively by another program?
root@DLINK:~# e2fsck -n /dev/sda
e2fsck 1.41.0 (10-Jul-2008)
e2fsck: Device or resource busy while trying to open /dev/sda
Filesystem mounted or opened exclusively by another program?

What do I do now?

Thanks.


DNS-323 FW1.10B7 WD20EARS_2TB Samsung_HD753LG_750G FFP_0.5
DNS-321 FW1.03  FFP_0.7 (Spare enclosure)
DNS-320 FW2.02 Hitachi_HDS5C3020ALA632_2TB Hitachi_HDS721010KLA330_1TB FFP_0.5

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB