Warning: long post 
[Edit]
For RAID configurations, see RobR35's post below.Okay... it's been a long time (
this topic has not been posted in for at least 120 days 
), but I finally solved the "disappearance act". Maybe it'll help you.
So... every disk has a "hidden" dev, where the NAS keeps its config files. If you have one HDD, then it's
/dev/sda4; if you have two, there's also a
/dev/sdb4. I've mounted them as
/mnt/HD/HD_a4 (and
/mnt/HD/HD_b4, since I have two HDDs):
mount /dev/sdb2 /mnt/HD/HD_b2 # The second HDD - not necessary if you have only one hard disk
mount /dev/sda4 /mnt/HD/HD_a4
mount /dev/sdb4 /mnt/HD/HD_b4 # Not necessary if you have only one HDD
When you define a share, the information is written in
/mnt/HD/HD_a4/.systemfile/.smb.xml (also in
/mnt/HD/HD_b4/.systemfile/.smb.xml, if you have two HDDs). A share looks like this:
<item>
<volume_raid>1</volume_raid>
<hd_serial>0AA0AA00</hd_serial>
<name>SHARE</name>
<comment></comment>
<path>/mnt/HD/HD_b2/SHARE</path>
<browseable>yes</browseable>
<public>yes</public>
<oplocks>no</oplocks>
<map_archive>no</map_archive>
<read_list>#User1#</read_list>
<write_list>#User2#</write_list>
<invalid_users>#nobody#</invalid_users>
<recycle_enable>0</recycle_enable>
<recycle_tree>1</recycle_tree>
</item>
I don't know why, but something goes amok when you use FFP or Debian, and sometimes
<hd_serial> messes up everything: for my Seagate HDD (serial number style:
0AA0AA00), everything is ok; for my WD HDD (serial number style:
WD-WCAV00000000), everything goes down in flames.
When I use Debian Squeeze and I add a share on my WD
using the web admin interface,
the <hd_serial> value is null (empty):
<hd_serial></hd_serial>
Everything is ok... until the first restart, when the share goes AWOL: at first, it's not displayed in the web admin interface, but it can be accessed. The problem is if you create/modify/delete another share, because the one(s) that was/were not displayed disappear(s) completely. Why? Dunno, don't really care; the only thing I know is that the NAS adds the correct serial number inside
.smb.xml file(s)
at restart, and everything blows.
So... here's what I did:
0. Connect to NAS via ssh (puTTY), create the folders needed to mount the system dev(s) and alter
/boot/linuxrc accordingly:
mkdir /mnt/HD/HD_b2 # The second HDD - not necessary if you have only one HDD
mkdir /mnt/HD/HD_a4
mkdir /mnt/HD/HD_b4 # Not necessary if you have only one HDD
nano /boot/linuxrc # Or
vi, whatever editor you use
Add the following lines:
mount /dev/sdb2 /mnt/HD/HD_b2 # The second HDD - not necessary if you have only one HDD
mount /dev/sda4 /mnt/HD/HD_a4
mount /dev/sdb4 /mnt/HD/HD_b4 # Not necessary if you have only one HDD
1. Access the web admin interface and created a share on the "faulty" HDD.
2. Mount the system dev(s) and save the current share configuration(s):
mount /dev/sda4 /mnt/HD/HD_a4
mount /dev/sdb4 /mnt/HD/HD_b4 # Not necessary if you have only one HDD
cp /mnt/HD/HD_a4/.systemfile/.smb.xml /mnt/HD/HD_a2/a2.smb.xml
cp /mnt/HD/HD_b4/.systemfile/.smb.xml /mnt/HD/HD_a2/b2.smb.xml # Not necessary if you have only one HDD
3. Access the web admin interface and reboot the NAS, so it can put the faulty serial inside
.smb.xml.
4. After restart, compare the new
.smb.xml file(s) with
a2.smb.xml (and
b2.smb.xml, if you have two HDDs - they should be identical). You'll see the differences (the affected field is
<hd_serial></hd_serial> only).
Here's how I fixed it: after detecting the "faulty" HDD serial number (mine was something like
WD-WCAV00000000; yours might look different), I replaced it using
sed (I added the lines at the bottom of
/boot/linuxrc):
sed -i 's/WD-WCAV00000000//g' /mnt/HD/HD_a4/.systemfile/.smb.xml
sed -i 's/WD-WCAV00000000//g' /mnt/HD/HD_b4/.systemfile/.smb.xml
That's it. It took me almost two years, but hey... better late than never
