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-05-31 05:42:28

bscott
Member
Registered: 2007-07-13
Posts: 48

Why Fun_Plug didn't work for me (at first...)

I'm in the middle of a process which will undoubtedly involve me posting requests for help here soon, so I'm taking this opportunity to write up an experience which may possibly help someone else (provided they hit on the right search terms anyway!)  It involves how I had to spend almost 3 hours trying to figure out why fun_plug could not be reinstalled even though it worked fine the first time I did it...

I'm upgrading hard drives in my DNS-323 (firmware 1.03 I think) using a complicated procedure that would take too long to explain here, but has to do with my backups being scattered all over half a dozen external drives and stacks of burned DVDs, and how I'm shifting my larger storage devices between internal (PC) and DNS-323.  The result is, I had to pull out both old (120gig) drives first, put a new 320gig into the DNS-323, spend days collecting all the data I wanted to put on it, and only then install the other 320gig drive in hopes it would form a RAID1 mirror.

Of course, it hasn't done that yet, and I found instructions (which I hope to decipher in due course) about using MDADM to "hot add" the second drive, but first of course, I have to re-enable fun_plug!  It couldn't be easier to install, though, except this time it wouldn't work.  I tried many variations on the process, everything I could think of, but the telnet server simply failed to respond and the .tar file remained untouched.

I was about to give up and post a request for help here when I finally hit upon a possibility - install it on Volume_2!  Thing is, the instructions say to install on "the root of the first volume", so I'd been trying Volume_1.  But - and this is the big "but"! - I'd installed the first drive into the left-hand slot, thinking that was slot one.  It was indeed "Volume_1" but was it "HD_a2"?!  Installing fun_plug on Volume_2 (the new, blank drive) worked fine.

Now that I have telnet access I see that actually, my first drive is HD_b2 (sdb2?!) and the new, blank drive is HD_a2.  Either way, fun_plug doesn't work when put onto Volume_1 when Volume_1 isn't on sda, is I guess the point to be made...

I hope this helps someone, or leads to a refinement in the installation instructions that will further improve an already excellent package.  I gotta go figure out how to make my drives become twins now.

Offline

 

#2 2008-05-31 06:29:04

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Why Fun_Plug didn't work for me (at first...)

What it's more likely to lead to is - search - that's been covered before.

Also covered before is how to add a single drive and create a RAID1 array - and it goes something like this - assuming you're running fw 1.05

Insert new (or clean) drive of larger than or equal capacity.
Sign in to web admin page, the next screen should be the format screen
Check the create a RAID array box and click next
Sit back and wait until it finishes formatting
Restart and watch it sync.

Seriously - unless you're really into unusual stuff, it's probably been done before (or at least tried) and there's a thread discussing it in the forum.  Don't beat yourself to death - search.

Offline

 

#3 2008-05-31 07:35:37

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: Why Fun_Plug didn't work for me (at first...)

My recomendation is to avoid using mdadm unless you really know what you are doing.  While is will work and create a working raid, the DNS web software will not like it and will give you errors, even locking you out of the web admin (it stops at an error screen).  There are several other steps to follow to get the web admin tool to like a hand created array, and I have not yet been able to do it the same way 2 times in a row without modifying the flash.  But, if you are willing to give it a go, be my guess, but don't get too disappointed and try not to brick it.


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

#4 2008-05-31 14:58:57

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Why Fun_Plug didn't work for me (at first...)

Rereading your post, I have to wonder why, having pulled both the old 120GB drives, why you didn't just install the new ones and create the RAID1 array at that point, I just do not see the logic behind installing one drive, loading it with data and then trying to install a second one - unless you didn't have both drives when you started.

Anyway - as  I pointed out - firmware 1.05 allows this to be done from the web admin pages.

Offline

 

#5 2008-05-31 16:29:42

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Why Fun_Plug didn't work for me (at first...)

I tried a variety of search terms, but when you're not sure what sort of problem you're facing it can be hard to guess what someone else might have called it.  "fun_plug won't work" got me nowhere relevant, for instance.  Besides, I know enough about how the exploit works to realize that it's very nearly too simple to fail, so I assumed I was overlooking something obvious out of tiredness or whatever.

Thanks for the advice on avoiding mdadm, but I'm nearly as worried about upgrading the firmware after all the reading I've done here.  Guess I'll have to take another day or so and re-back things up just to be on the safe side, much as I didn't want to go through all that again so soon.  (Either that or drop $60 on yet another 320gig drive... NAH!)

Fordem - the second 320gig drive was the boot drive of my PC, and was itself nearly full from remnants of my old Windows data not to mention scattered backups from various other devices, plus some huge DV files (up to 19 gigs each).  A lot had to get tidied up, moved around - and I had to copy the current (Ubuntu) OS partitions to one of the newly-freed 120gig drives so it could become my new internal storage - before I could move the 320gig into the DNS-323 with its near-identical cousin.  It's a long story.

Offline

 

#6 2008-05-31 18:42:48

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Why Fun_Plug didn't work for me (at first...)

bscott - I can understand that, I myself have been moving drives around, but as long as you have the one drive in and functional, getting a second one in and into a RAID1 array is now a very simple task - if you're running firmware 1.05.

Just make sure you have a backup (out of an abundance of caution) and the drive you're adding to the DNS-323 is "clean" ie no partitions or data, and it becomes a matter of point & click in the web interface.

Offline

 

#7 2008-06-01 03:08:21

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Why Fun_Plug didn't work for me (at first...)

> and it becomes a matter of point & click

Not so fast!  I blanked the drive of partitions last night after upgrading to v1.05, and it let me format and "convert to RAID1" all right.  But after rebooting and leaving it overnight, it still shows "Degraded" with no estimated time for resync.

Searching here reveals a thread pointing out that v1.04 formats drives differently than v1.03, so I assume v1.05 is the same.  Thus, I've got a v1.03-formatted drive paired with a v1.05 era one, and so naturally they won't sync.  That @$#*^& figures!

Given that my main problem is having nowhere else to put all my data *at the same time*, other than these two drives, I'm going to explore how to copy all the data to the second drive somehow, then reformat the first one under v1.05 and try to pair them again.  I'm sure I'll run into some snag, I always do... I expect I'll have to break the RAID pair first, then reformat, and etc.

Offline

 

#8 2008-06-01 05:05:30

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Why Fun_Plug didn't work for me (at first...)

Just a suggestion - remove the disk with your data and reformat the remaining drive so that it has the correct partition structure for 1.05.  Install the disk with the data in a PC, if you're a Windows user, install ext2ifs and transfer the data to the disk in the DNS-323, delete the partitions off of the disk and then install it in the DNS-323 and allow it to create the RAID1 array.

Offline

 

#9 2008-06-01 06:05:23

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Why Fun_Plug didn't work for me (at first...)

Sadly, looks like that's what I'm going to have to do.  I've tried to think of any way to avoid having to funnel the data back into the DNS-323 through the Ethernet port, due to an unrelated problem I'm having with the Ethernet drivers in my PC (Ubuntu seems to run both my motherboard port and a PCI card I've tried at 100mbps even though they're supposed to do gigabit).  It would take the best part of a day to copy the data back, even with it all in one place as it is now, and that's another day on top of nearly a week's effective downtime - but try as I might, I can't find anyone else to blame...

Thanks for the assistance.

Offline

 

#10 2008-06-01 15:03:54

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Why Fun_Plug didn't work for me (at first...)

Well - assuming that you have fun_plug & telnet - I believe there are several ways to achieve that, but being a linux noob, anything I suggest could come from a lack of knowledge.

As before, start by removing the drive with the data and then formatting the remaining drive so that it has the correct partition structure, next reinstall the drive with the data so that you have two separate volumes and then transfer the data using cp, rsync or similar - I'm assuming that linux has an equivalent to the xcopy command in MS DOS/Windows

Offline

 

#11 2008-06-03 12:51:06

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Why Fun_Plug didn't work for me (at first...)

fordem wrote:

As before, start by removing the drive with the data and then formatting the remaining drive so that it has the correct partition structure, next reinstall the drive with the data so that you have two separate volumes and then transfer the data using cp, rsync or similar

Thanks, that suggestion worked GREAT - for the last 100 gigs or so of my data.  The first 200 gigs, however, took nearly 36 hours to copy, what with one thing and another... please, next time post your ideas directly into my brain so they don't have to wait for me to come back here and check them. 

I mean, had I thought a little further I might have come up with that very idea myself, but I don't sign onto forums like this just to do my OWN thinking!

Now I have to go and figure out a way to get the functionality of something like dircmp on the DNS, so I can verify the copy (there were a few quirks during the process) - I'm sure I'll come up with something compliated and time-consuming before returning here to read your quick'n'easy idea.

Offline

 

#12 2008-06-03 15:23:26

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Why Fun_Plug didn't work for me (at first...)

Sorry - no quick'n'easy ideas from this end - you're now dabbling in, what is for me, dark & murky waters.

Offline

 

#13 2008-06-04 12:03:51

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Why Fun_Plug didn't work for me (at first...)

YARGH!  It's blanked both drives.

After checking the copy had gone OK, I took the secondary drive back out, blanked the partitions, and put it back in.  DNS-323 offered to format it and convert to RAID1, and after the format and reboot, activity lights suggested a mirroring was underway.  But I checked the Status page and it seemed to show almost 100% available space on the mirror volume!  (should have been over 90% full)

I shut down (via the web interface) as quickly as I could, but now both drives show as blank when put into my PC and mounted directly.

Most if not all my data is backed up somewhere or other, but I've still lost some small-but-important bits and bobs, not to mention the DAYS of work it took to assemble everything together onto one drive. 

There's probably some utility I can use to get back most of the data, but this still sucks rocks.  Why would it sync FROM a freshly-formatted drive TO the main (full) drive?!?!

Offline

 

#14 2008-06-04 14:31:57

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: Why Fun_Plug didn't work for me (at first...)

The superblock, the hd_magic_num, and the raidtab2web configuration files stored both on the drives and in the flash tell it which one is the master.  I have found over the past few weeks of manually building the raid on the unit (using mdadm) that the unit is expecting new drive, not a blanked out drive that the unit already knows.  It stores the hard drive's serial number in flash, so it knows if it is a new drive, or if you just erased the one that was there before.  I'm still in the process of working it all out how it does it, but I also learned that the web utitlity looks at the /tmp directory for specific file names that were written there during startup and other processes, in order to determine the status of the drives.


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

#15 2008-06-04 14:50:34

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Why Fun_Plug didn't work for me (at first...)

> the unit is expecting new drive, not a blanked out drive that the unit already
> knows.  It stores the hard drive's serial number in flash, so it knows if it is a
> new drive, or if you just erased the one that was there

Nefarious!  And sneaky!  Or is all that really just a fancy way of saying the D-Link corporation hates me?

I've run e2undel on both drives - on the (former) master, it found almost nothing, just one zero-length file (inode).  On the second, which should have been fully formatted, it errors out with "Ext2 File too big" - I had several files well over 10gig but I suspect they're not the actual issue. 

I'm even less clear on how to use another undelete tool, debugfs, but regardless, it refuses to open the former-master drive, and doesn't appear to find anything on the formatted drive (although I am most likely just using the tool improperly).

I'd like to take some kind of shot on recovering at least some information, but that may end up being as much trouble as just starting from scratch (now 9 days into this whole thing...) and I'm about ready to give up on it all and go back to etch-a-sketch at this point.  (Although my wife would prefer I restore at least her 7 gigs worth of baby pics to some kind of online storage...)

Offline

 

#16 2008-06-04 15:05:58

fordem
Member
Registered: 2007-01-26
Posts: 1938

Re: Why Fun_Plug didn't work for me (at first...)

bq041 wrote:

It stores the hard drive's serial number in flash, so it knows if it is a new drive, or if you just erased the one that was there before.

Is this hardware serial as in provided by the drives manufacturer or volume serial as in created whilst formatting, and does it store just the last drive in that bay?

Offline

 

#17 2008-06-04 15:29:48

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: Why Fun_Plug didn't work for me (at first...)

The hardware serial number (the same one stampped on my drive's label).  It stores both drives, in the order of the bay in which they were first setup.  This is how the units give the screen about having the drives in the wrong location when using RAID 1 and you physically swap the drive locations.

To better answer the intent (I think) of your question, it only stores the last drives that the built in utility programs set-up.  For example, if you took out your RAID 1 and put in 2 new disks and formatted them as standard.  The serial numbers of the new disks would be stored, and the numbers of the array woould be gone.  This can cause problems if trying to re-insert the array.

Last edited by bq041 (2008-06-04 15:38:41)


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

#18 2008-06-04 15:42:45

bq041
Member
From: USA
Registered: 2008-03-19
Posts: 709

Re: Why Fun_Plug didn't work for me (at first...)

By the way, this is also what I think has to do with part of the 94% error when using the web to format.  I've been working mainly with the same 2 drives, and getting them to partition and format correctly has been a bear.  If I remove all the partitions and try to use the web to set it back up, I (most of the time) get hung up.  The next login via telnet (only working with the second drive so ffp is still on the first) still shows no partitions.  I then have to manualy set them up.  I think the web utilities have some problems when the serial number matches a known one in the flash.  A different drive works fine, then I can go mack to the original with no problems.


DNS-323     F/W: 1.04b84  H/W: A1  ffp: 0.5  Drives: 2X 400 GB Seagate SATA-300
DNS-323     F/W: 1.05b28  H/W: B1  ffp: 0.5  Drives: 2X 1 TB  WD SATA-300
DSM-G600   F/W: 1.02       H/W: B                Drive:  500 GB WD ATA

Offline

 

#19 2008-06-10 04:40:20

bscott
Member
Registered: 2007-07-13
Posts: 48

Re: Why Fun_Plug didn't work for me (at first...)

Well, after taking several days off from the computer (it came down to that or throwing it off the balcony), I've decided to give up on using RAID1.  I'm not sure how much I can recover from these 'blanked' drives - a simple "dd" piped through "strings" confirms that a lot of my information is still there, no surprise, so it's a matter of researching ext2 recovery utilities and finding out how much can be pulled off, for how much time/$$. (and I don't want to invest any more time or $, so I'm on the verge of just shitcanning the whole thing and moving on)

Going forward, I think I'll switch to one of the cron/rsync-based backup schemes described in the Wiki, instead of live mirroring.  This isn't what I bought the DNS-323 for, but I really don't want to go through anything like the events recounted in this thread ever again!  I don't see how any rational software design could ever result in a counter-intuitive move like blanking a full drive in the process of adding a new, blank mirror volume, but if that's possible then who knows what else may be lurking?  Someday maybe I'll be able to invest in a more robust RAID solution.

Thanks again, all who tried to help!

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB