Page 1 of 1
Lost my files!

Posted:
Thu Feb 28, 2013 11:15 pm
by lapasta
Hi!
I have been using FVDW for some time, and it has been great.
I don't use my HD all the time, just once every couple of months.
Yesterday I turned it on, and couldn't start the transmission server, and that it couldn't find my config file. After looking more carefully, I realized that it wasn't only the config file that was missing: all my files were missing too! In fact, the whole share partition!
There were no partitions, no shares, and no users defined at the web interface.
I begun thinking what could have caused it... :thinking
I had updated to 14.0 recently, and I don't remember using my HD after that, so maybe it was during the update... But I have been getting very strong thunderstorms here, and had some power failures, so maybe that is the cause. But in the end, I don't know. The web interface is working, and I can SSH to the device normally.
When I do a "df -h", I get
/dev/root
/dev/sda1
/dev/sda5
tmpfs
/dev/root
All of them summing to less than 1GB. I am thinking that my files should be in another partition, that isn't mounted, right? How can I find it and mount it back?
Re: Lost my files!

Posted:
Thu Feb 28, 2013 11:29 pm
by lapasta
Ok, after the dispair, I am able to think again.
A "fdisk -l" still lists all 8 partitions, just as they should be according to the installation howto. So my files should be safe.
But my fstab file is
- Code: Select all
none /proc proc rw
none /sys sysfs rw
none / ext3 rw
Which looked weird to me.
A complete df -h is:
- Code: Select all
/dev/root 242.2M 158.5M 71.2M 69% /
/dev/sda1 242.2M 158.5M 71.2M 69% /
/dev/sda5 771.1M 17.1M 746.2M 2% /rw_fs
tmpfs 4.9M 156.0K 4.7M 3% /rw_fs/tmp/usr/var
/dev/root 193.7M 111.3M 72.4M 61% /lacie-boot
As the configuration files are also missing, maybe also the partition that holds them isn't being mounted?
Can I "fix" my configuration as it is, or I just re-install the firmware again on top of it?
Thanks!
Re: Lost my files!

Posted:
Fri Mar 01, 2013 8:31 am
by fvdw
The partition table is just some sectors in the beginning of the disk, it doesn't guarantee that the partition itself is still ok
Yes your data files (the shared folders) are on a separate partition, sda8.
It seems sda8 is not mounted for whatever reason.
As first step I would try to mount sda8 manually
for instance like this
- Code: Select all
mkdir /mnt/sda8
mount /dev/sda8 /mnt/sda8
If that works you can change to the folder /mnt/sda8 and check if your data is still there
To see what is mounted use the command
- Code: Select all
mount
I think sda5 is mounted otherwise you could not login , it contains the nas database,
Maybe the only problem is a corrupt nas database preventing mounting of sda8 during boot.
Re: Lost my files!

Posted:
Fri Mar 01, 2013 1:57 pm
by lapasta
Yes, mounting /dev/sda8 worked fine, and aparently my files are still there (at least, the folder structure is there, I didn't open any file to check the contents).
The result of a
mount command is
- Code: Select all
rootfs on / type rootfs (rw)
/dev/root on / type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
/dev/sda1 on / type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
none on /proc type proc (rw,relatime)
none on /sys type sysfs (rw,relatime)
/dev/sda5 on /rw_fs type ext3 (rw,noatime,errors=continue,barrier=0,data=ordered)
tmpfs on /rw_fs/tmp/usr/var type tmpfs (rw,relatime,size=5000k)
/dev/root on /lacie-boot type ext3 (rw,relatime,errors=continue,barrier=0,data=ordered)
I don't see there many of those 8 partitions the disk has (ok, 6, as one is the swap and the other is just the extended partition that contain the others). Is it just sda8 that I am missing or some other as well?
And if it is just a database problem, how can I re-generate it?
Thanks,
Re: Lost my files!

Posted:
Fri Mar 01, 2013 3:07 pm
by lapasta
Through the web interface I saw that I have a database backup from December. Can I just restore it, even though it was created on a previous version of the firmware?
Does the database holds only config information, or also information from the files I have (and in that case I would lose access to files written after December)?
Re: Lost my files!

Posted:
Fri Mar 01, 2013 5:09 pm
by fvdw
seems you only miss sda8.
You could try to do that, restoring the backup, but I can not guarantee that it will work. However it will never cause loss of your data. The database only contains settings for the system.
There is One thing you should not do before knowing what is going on, and thats creating or deleting shared folders.
Lok in the folder /rw-fs/etc to the file wih name nas_conf_db.xml
Compare it size with the one in /rw_fs which will have name nas_conf_db_ok.xml (this is the copy you saved and will be used for restore).
if the "ok" one is much lager then the first one then it is very likely that it is corrupt and you could try the restore. If it has similar size then its not sure.
Re: Lost my files!

Posted:
Tue Mar 05, 2013 12:15 am
by lapasta
Hi there,
Indeed it was a corrupt database. The new database was half the size of the previous one.
I diffed the two files, and as there were only missing things, I proceeded to do a recovery.
And it went fine and well! My NAS is back to normal, and my files intact! Yay!
I just donated 10euros to pay you a drink :beer:
Cheers for such a robust and awesome firmware you did there!
Thanks,
Leonardo
Re: Lost my files!

Posted:
Wed Mar 06, 2013 8:33 am
by fvdw
:-D glad to hear that we could solve this issue Leonardo.
I build in the the restore of a database because once I had myself this problem :laughat , sometimes a backup is very useful
And thanks very much for the donation, its much appreciated by Jocko and me. At least we can recover some costs to keep this site up and running