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-02-24 05:48:15

roddersg
New member
Registered: 2008-02-02
Posts: 3

funplug not working after inserting 2nd hard disk (Solution)

Firmware: 1.04, funplug0.3, 2xSamsung500Gb (separate disks)

Background:
DNS-323 working with funplug 0.3, firmware 1.03, 1xSamsung 500Gb inserted in left-bay
Changed:
Firmware 1.04, added 2nd Samsung 500Gb on right-bay (as separate HD)
Problem:
Funplug does not start

Solution:
Remove original HD from left-bay and insert into right-bay
New 2nd HD into left-bay
Re-boot

Notes:
the hard disks are now named as follows after the switch
Right-bay - Volume_2 /mnt/HD_a2     (old name was Volume_1)
Left-bay - Volume_1   /mnt/HD_b2

apparently, if you insert the new hard-disk into the right bay, the bios expects fun_plug to be there in Volume_2 instead of Volume_1.

I now have 4 partitions on the 2 drives:  /mnt/HD_a2, HD_a4, HD_b2, HD_b4
when I remove the drives and inspect them on a Linux system, I find that HD_a4 and HD_b4 are actually Swap partitions.

Anyone care to expand this before I put it into the wiki?

Offline

 

#2 2008-02-24 08:35:50

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: funplug not working after inserting 2nd hard disk (Solution)

roddersg wrote:

apparently, if you insert the new hard-disk into the right bay, the bios expects fun_plug to be there in Volume_2 instead of Volume_1.

This is not quite correct.  Volume_1 and Volume_2 are the SMB share names created in the Samba config file (smb.conf).

The DNS-323 start-up scripts http://dns323.kood.org/howto:fun_plug do not reference the filesystem with SMB share names.

The script which checks for the presence of a "fun_plug" script is called /usr/sbin/chk_fun_plug

Code:

 
#!/bin/sh

sleep 30

Dir_Len=28
Filename_Len=26
CUSTOMIZEHDPATH=/sys/custom/shared_name/HD

file=$(find "$CUSTOMIZEHDPATH"/*)
HD_Path=`expr substr "$file" "$Dir_Len" "$Filename_Len"`
HD_Path=$HD_Path"a2"

if [ -e /mnt/$HD_Path/fun_plug ]; then
      echo "function plug enable"
      /mnt/$HD_Path/fun_plug
fi

The shell variable HD_path (on my system) is evaluated to 'HD_a2' before the "if" statement, so
this script tests for an executable file '/mnt/HD_a2/fun_plug' and executes this file, if the
test statement is evaluated true.

Last edited by mig (2008-02-24 08:37:02)


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#3 2008-02-24 09:00:19

roddersg
New member
Registered: 2008-02-02
Posts: 3

Re: funplug not working after inserting 2nd hard disk (Solution)

Ok, I would accept that Volume_1 and Volume_2 are smb names.

But how come, the same drives when swapped, i.e. cannot make fun_plug run.  hence, there must be some sequencing as the names of the HDs in the locations.

I would concur that if you have one HD, it would be named HD_a2
If you have 2 HD, then the one on the right bay is named HD_a2, and you must place funplug there.

In my case, if that drive is in the left bay, a fun_plug in the right bay starts first.

Offline

 

#4 2008-02-24 11:21:31

mig
Member
From: Seattle, WA
Registered: 2006-12-21
Posts: 532

Re: funplug not working after inserting 2nd hard disk (Solution)

In linux, the hard drives are assigned device names based on the order they are
detected on the hard drive controllers.

For the DNS-323 the hard drive controllers are labeled on the circuit board in the photo
http://dns323.kood.org/_detail/11.jpg?i … ache=cache as HDD0 and HDD1

In a single hard drive configuration, regardless if the drive is attached to HDD0 or HDD1,
the single hard drive will be detected and assigned the device name /dev/sda.  The D-Link
scripts will mount the second partition on the /dev/sda drive to /mnt/HD_a2.

In a dual hard drive configuration, the hard drive attached to the  HDD0 controller will be detected and
assigned the device namd /dev/sda.  The hard drive attached to the HDD1 controller will be detected and
assigned the device name /dev/sdb.  The D-Link scripts will mount the second partition on the /dev/sda
drive to /mnt/HD_a2 and the second partion on the /dev/sdb drive to /mnt/HD_b2

In either case, the /usr/sbin/chk_fun_plug will look for an executable file named 'fun_plug' in the /mnt/HD_a2 directory.

Last edited by mig (2008-02-28 20:06:51)


DNS-323 • 2x Seagate Barracuda ES 7200.10 ST3250620NS 250GB SATAII (3.0Gb/s) 7200RPM 16MB • RAID1 • FW1.03 • ext2 
Fonz's v0.3 fun_plug http://www.inreto.de/dns323/fun-plug

Offline

 

#5 2008-02-24 17:05:05

roddersg
New member
Registered: 2008-02-02
Posts: 3

Re: funplug not working after inserting 2nd hard disk (Solution)

Thanks mig, for the information.
This really confirms that the right drive is HD0, hence it will be the boot drive.

I'll write this up in the wiki.

Offline

 

#6 2009-03-22 01:48:48

stevo
New member
Registered: 2008-09-10
Posts: 2
Website

Re: funplug not working after inserting 2nd hard disk (Solution)

thanks for the explanation too.. pity I didn't find this post before I added my second drive.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB