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 2007-12-09 12:25:25

lothalev
Member
Registered: 2007-12-09
Posts: 14

313 change filesystem from NTFS to ext2

Hello!

I recently bought a DNS-313 v1.00 unit. After long fight with the crappy Click'n'Connect software, it finally formatted a 500-gig WD-Caviar hard disk, booted and became operable.

Connecting the unit via USB revealed 4 partitions: swap, two ext2 partitions (one with the system, the other one probably for /tmp, guessing from the shell scripts) and last, big NTFS partition.

I wanted to change the filesystem to ext2 (as it is easier and faster to use it with Linux, than ntfs). Changed filesystem type in fdisk, formatted to ext2, modified shell script (/etc/hotplug/satamount) from ufsd (the unit ships with a closed-source commercial NTFS driver) to ext2 and rebooted.

Unfortunately, shell scripts in /etc got overwritten (probably from initrd image - rd.gz or rootfs.gz) and the big ext2 partition did not mount (as the system tried to mount it as ntfs).

I fiddled a bit with it over telnet (enter 5784468 after logging in to get to the command prompt!), changed root password and logged in as root. That enabled me to mount the ext2 partition manually.
I also modified one of the shell scripts stored in flash memory (mounted /dev/mtdblock0 - minix filesystem) to mount the FS, but that didn't work (don't know why).

I would like to permanently modify boot scripts in rd.gz or rootfs.gz, but don't know how to unpack them. The images are in fact NOT compressed with gz, as extension suggests, but have U-Boot/PPCBoot format.

Did anyone of You manage to unpack one of those images, compress them back and make modified images work with a DNS unit?
I'd be grateful for any help with modifying those files smile

Offline

 

#2 2007-12-09 13:46:55

lothalev
Member
Registered: 2007-12-09
Posts: 14

Re: 313 change filesystem from NTFS to ext2

I actually managed to mount the filesystem, modifying rc.init.sh (contained in flash /dev/mtdblock0; can be also changed by downloading configuration file via web interface, changing the file and putting back on the device, using the same web interface)

I added 2 lines to the file:
mkdir /mnt/HD_a2 >/dev/null
/bin/mount -t ext2 /dev/sda2 /mnt/HD_a2 > /dev/null

First line is needed, as the partition wouldn't mount without it (root filesystem has an empty /mnt directory at bootup)
Unfortunately some part of configuration (might be because of editing rc.init.sh) got corrupted and "device name" got set to some random characters. Will look into it later smile

Offline

 

#3 2008-03-04 13:12:28

lt_gustavsen
Member
Registered: 2008-03-04
Posts: 8

Re: 313 change filesystem from NTFS to ext2

Thanks for this.
It works here too, but if I write reboot  in the terminal the  rc.init.sh is overwritten.
I wonder what is the differences between a web gui restart and reboot from the shell?

Do you have any solutions on the "device name" problem and the webgui?

Offline

 

#4 2008-03-06 09:25:00

lt_gustavsen
Member
Registered: 2008-03-04
Posts: 8

Re: 313 change filesystem from NTFS to ext2

It looks like if I try to run a more complex funplug script it reset the rc.init.sh and my mount is lost. So my hack solution for now is to execute a scrip on the workstation side after the 313 is booted. It starts the telnet demon, login and mount the ext2 filesytem and start fun_plug 0.5.

Here is my script, I found most of it on the net. The drawback is of course that it sends password in cleartext. And my goal with all this was in the first place to run ext2 and a ssh server with sftp support.

##########start-313.sh#####

#!/bin/sh
host=192.168.2.105
port=23
login=root
passwd=11111
unlock=5784468
cmd1="/bin/mount -t ext2 /dev/sda2 /mnt/HD_a2"
cmd2="/mnt/HD_a2/fun_plug"

#start the telnet demon, since it off by default in my firmware (1.01b06)
wget --http-user=admin http://192.168.2.105/goform/doXinetd  --post-data "f_button_name=Start Telnet" -O /dev/null

sleep 4
(echo open ${host} ${port}
sleep 1
echo ${login}
sleep 1
echo ${passwd}
sleep 1
echo ${unlock}
sleep 1
#mounting my ext2 disk
echo ${cmd1}
sleep 1
#starting funplug-0.5 from fonz, with a sftp server
echo ${cmd2}
sleep 1
echo exit) | telnet

#########################

Offline

 

#5 2008-03-06 09:31:04

lt_gustavsen
Member
Registered: 2008-03-04
Posts: 8

Re: 313 change filesystem from NTFS to ext2

I guess it's more pretty to write the above wget line as
wget --http-user=admin http://$host/goform/doXinetd  --post-data "f_button_name=Start Telnet" -O /dev/null

And the telnet demon be stopped after the the ssh demon is up and running in the same script with
wget --http-user=admin http://$host/goform/doXinetd  --post-data "f_button_name=Stop Telnet" -O /dev/null

Offline

 

#6 2008-03-24 12:38:36

skandy
New member
Registered: 2008-03-24
Posts: 4

Re: 313 change filesystem from NTFS to ext2

I hope you'll forgive my ignorance.
I'm a 313 owner and I have XP and Leopard at my disposal (if needed I could boot a live linux though). I think I need to change FS to ext2 because of poor transfer speeds (down to 4MB/s after defrag) and the usual NTFS fragmentation so I guess what I'm asking of you is a step by step dumbproof guide.
But before we begin: will I be able to access the drive content form Leopard and XP once the drive is reformatted? I know it's a stupid question, but one gotta ask...

My fw version is 1.01b6 and the 313 is connected to a gigabit network (D-Link DIR 655), a macbook pro and a windows XP laptop

Last edited by skandy (2008-03-24 13:04:18)

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB