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-11 03:24:50

jdoering
Member
Registered: 2008-04-10
Posts: 95

hd_magic_num details

(I already hijacked the thread on recovery too much ... sorry; posting details on the disks ID question here.)

mig wrote:

jdoering wrote:

I noticed that disk ids are generated and stored on each disk and written to the DNS-323's flash-based minix filesystems.

What files are (or contain) the disk ids and were do you see these disk ids being stored?
Do you know what process is generating these disk ids?

The ids are stored on the disks at:

/mnt/HD_a4/.systemfile/hd_magic_num
/mnt/HD_b4/.systemfile/hd_magic_num

Contents from a4:
428576
861110

Contents from b4:
428576
861110

The ids are stored in NVRAM in the minix filesysystems (/dev/mtdblock0 & /dev/mtdblock1) as:

/hd_magic_num

Here's the content of my file from NVRAM for my RAID-1 setup with two identical disks (xxxx represent my real serial numbers):

911321
861110
S13UJ1KPCxxxx1
S13UJ1KPCxxxx2


Note that I've done some "strange" tests on my unit trying to recover an older RAID-1, set, etc. So I'm not sure exactly why the data above seems to be slightly "out-of-sync" or what the implications are.

I'm not sure how / when they are created; but the following binaries inside /image.cfs include references to "hd_magic_num":

/sbin/mbr
/sbin/hd_verify

mbr is referenced from the web server binary (webs) as well as /sbin/write_raidtab and other files. hd_verify is also referenced by webs and other places.

Obviously for a RAID-1 array; the DNS-323 must be able to initialize a new disk to replace a failed one. I don't know if that preserves the magic number or not. I also don't know what the impact of inserting disks with different numbers is. Maybe the DNS-323 just adopts the new numbers... who knows.

-Jeff

Offline

 

#2 2008-05-11 03:48:14

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

Re: hd_magic_num details

OK - the raid set swaps that I had done were done on fw 1.03 - now - I could be mistaken, but I don't recall there being a /.systemfile directory in 1.03, I do recall there being a /.lpd - can anyone confirm this?

Is it possible that there was a change made with firmware 1.04?

Edit - thinking back there were changes made along the way, but my memory is not clear as to exactly when those changes were made.

I can recall not being able to get the DNS-323 to detect and report simulated drive failures - even with RAID1 arrays and this was fixed by some one of the firmware upgrades - I don't recall which one - also somewhere along the line the unit acquired the capability to detect & report that the RAID members were incorrectly positioned and asking to have them repositioned (or words to that effect).

I do know with firmware 1.04 came the problems of pink/purple/white LEDs and degraded array messages.

Perhaps someone needs to retest the RAID set swap.

Last edited by fordem (2008-05-11 03:59:52)

Offline

 

#3 2008-05-11 18:10:09

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

Re: hd_magic_num details

Interesting, however my hd_magic_num files on both my disks are the same.

Code:

/mnt/HD_a2/.systemfile # cat hd_magic_num
933552

/mnt/HD_b2/.systemfile # cat hd_magic_num
933552

However, you can clearly see that the first disk is (or is supposed to be) part of a 2 disk RAID 1 array when I read out the superblock:

Code:

 mdadm --examine /dev/sda2
/dev/sda2:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 91e041fd:d4d74f22:11b2c76e:e1f6bb05
  Creation Time : Tue Jan 15 19:54:28 2008
     Raid Level : raid1
    Device Size : 389021888 (371.00 GiB 398.36 GB)
     Array Size : 389021888 (371.00 GiB 398.36 GB)
   Raid Devices : 2
  Total Devices : 2
Preferred Minor : 0

    Update Time : Tue Feb 19 18:42:05 2008
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0
       Checksum : aa0c271e - correct
         Events : 0.219099


      Number   Major   Minor   RaidDevice State
this     0       8        2        0      active sync   /dev/sda2

   0     0       8        2        0      active sync   /dev/sda2
   1     1       8       18        1      active sync   /dev/sdb2

And so is the second hard drive, although it is from a different array...

Code:

/mnt/HD_a2/.systemfile # mdadm --examine /dev/sdb2
/dev/sdb2:
          Magic : a92b4efc
        Version : 00.90.00
           UUID : 91e041fd:d4d74f22:11b2c76e:e1f6bb05
  Creation Time : Tue Jan 15 19:54:28 2008
     Raid Level : raid1
    Device Size : 389021888 (371.00 GiB 398.36 GB)
     Array Size : 389021888 (371.00 GiB 398.36 GB)
   Raid Devices : 2
  Total Devices : 1
Preferred Minor : 0

    Update Time : Fri May  2 13:56:58 2008
          State : clean
 Active Devices : 1
Working Devices : 1
 Failed Devices : 0
  Spare Devices : 0
       Checksum : aa6c224e - correct
         Events : 0.219161


      Number   Major   Minor   RaidDevice State
this     1       8       18        1      active sync   /dev/sdb2

   0     0       0        0        0      removed
   1     1       8       18        1      active sync   /dev/sdb2

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-11 22:02:26

jdoering
Member
Registered: 2008-04-10
Posts: 95

Re: hd_magic_num details

Hmm... the files I cited where from HD_a4 & HD_b4; not HD_a2 and HD_b2. I didn't check that file was in both places since I'd found a string match to HD_a4 in some binary.

Offline

 

#5 2008-05-11 23:31:34

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

Re: hd_magic_num details

I'm not running with partitions sda4 and sdb4.  These extra partitions came about in F/W 1.04, (or maybe H/W B1, I can't remember) of which I am running on both my boxes.  I originally had 1.03 (actually 1.02 on the old one) and did not want to have the disk structure different than I had before, so I made sure it was still set-up with sda(b)1 as swap space and sda(b)2 as my working partitions.  I have no other partitions.  Actually, this has worked very well, as I have not expirienced any of the probles people are complaining about on this site that have to do with F/W 1.04.

I tried a new set of disks in my newer DNS and I did get the extra partitions when I set it up via the web admin.  I re-did it through telnet and fdisk to the way I wanted them (to match my other unit) and viola, everything seems to work great.

Last edited by bq041 (2008-05-11 23:32:11)


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

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB