PDA

Bekijk de volledige versie : hard disk reformat



modelamark
09-07-2007, 22:21
I partioned my harddisk ext3 and successfully connected it to my wl500gp. It happened twice to me now that it can not mount the disk anymore (Philips 450 Gb USB 2.0 drive with Hitatchi disk inside). When I try to mount it from windows, it can recognize the partitions, but claims I have to format.
I don't like to loose my data twice a year and I have not found any recovery programs for ext2/3 partitions.
Any idea what might be causing this ?

al37919
10-07-2007, 09:01
I have not found any recovery programs for ext2/3 partitions
what about e2fsck?

modelamark
10-07-2007, 11:53
what about e2fsck?
Thanks, I discovered that command yesterday, but it gave a lot of errors on the disc and could not recover it. I wonder what could cause this, a bad disc or a wrong way of accessing. I did have a lot of files on there with really strange file names including characters like " ' [ ` Maybe the file system goes overboard with that. The first signs of things going wrong was that I could not delete certain files.
Maybe it is better to access it only with FTP and not with Samba. Next time I will also make to or 3 smaller partitions instead of 1 big one. Maybe that is the problem.

modelamark
12-07-2007, 07:03
I think shutting down is a problem. If you pull out the disc that has a ext3 partition, it will complain with e2fsck that the disc was not properly unmounted.
I tried
umount /dev/discs/disc0/part1
but it complains about an invalid argument

al37919
12-07-2007, 09:28
I observe similar situation: when I want to run e2fsck (I do it about once per month), usually I can't easily unmount fs. Likely, before that all the services which have open files on that hdd should be also killed. So usually I reboot the router with hdd disconnected (to avoid running of the programs started on booting from post-boot, init.d, ...). Then I connect hdd. It is automounted, but can be easily dismounted. After that complicated procedure I'm able to run e2fsck.

Conclusion: if you want to disconnect the hdd safely --- shutdown router.

modelamark
12-07-2007, 19:07
how do you shutdown the router ? isnt usually with
shutdown -now
on linux ? That command is not present, just reboot

al37919
12-07-2007, 19:39
actually, shutdown is a command intended just for graceful halting in multiuser environment (it sends preliminary messages to all interested people ... etc). It seems that it is really missing here, probably because this router is not expected to be shared between multiple unix users...

Use 'halt' or 'reboot' for unconditional stopping of the system.

sven7
24-08-2007, 20:34
Hi Modelamark and al37919,

I have the same issue here, that makes me worry about if i keep using the HD for data storage. I just use the device for 1 month, and i think its related to sumba because i didn't unplug it at all. It also started with funny character and not able to delete file. Finally after the e2fsck, i lost everything. Do you have the issue now? any clue that fix it / avoid it ?

Thornz
29-01-2008, 18:23
* bump *

I have the same problem - and judging from other threads - so are a lot of other people. Resetting the router without first properly unmounting the HDD (either because of power outages or just my clumsiness), seems to corrupt the data on the external HDD very easily.

Does anyone figured out a way to prevent this or at least make sure that we get early notice of possible data corruption? A disk which is not reliable is hardly useful for archival purposes.

Thanks in advance for your suggestions!
Thornz

al37919
29-01-2008, 20:20
Actually, even executing halt or reboot commands does not ensure propper dismounting of the file systems :( The proof is in my thread mentioned at the end.

There is an easy solution. Unmounting is still a problem, however not a problem is to remount file system in read-only mode. E.g.:

mount -o remount,ro /dev/discs/disc0/part1
This command can be placed in /usr/local/sbin/pre-shutdown to be executed on every reboot.

Not bad idea would be to run

e2fsck -p /dev/discs/disc0/part1
on every start up (however you have to ensure that the file system to be checked is not mounted).

The general solution (which relies on the next yet unreleased version of the Oleg's firmware) is reported here (sorry, yet in Russian): http://wl500g.info/showthread.php?t=12221

Thornz
29-01-2008, 20:45
Great reply, al37919, exactly the sort of info I am looking for!
For now there are two excellent (it seems) suggestions that help controlling the issue. The general solution in the next fw release you're talking about, is it really a 100% waterproof solution to this data integrity problem or is it just the implementation of the two tips you mention? You're aware of any ETA for the next Oleg's fw upgrade? I was planning on reinstalling my router anyway but if the solution is forthcoming I might just hold off reinstalling until the new release of Oleg's gem...

Sorry about all the questions but my Russian isn't that good ;-)
At least the Russian explains why I searched this forum for half a day without finding clues :)

calebz
29-01-2008, 21:09
Flash to kamikaze.

al37919
29-01-2008, 23:01
Under the general solution I meant the reworked set of pre-/post- scripts. In the next release there will be a pre-mount file which is a nice place to put e2fsck checks without extra hassle. It is also possible to do it now but in a "not beautiful" way. When --- I don't know --- I'm not Oleg.

trampjuice
01-12-2009, 11:03
I frequently have to unplug my 1TB USB drive from the router, and -

A tip here - I simply use a UBuntu partition on my laptop. I plug the USB drive in, right click to unmount it, and then use Partition Manager in Ubuntu to repair the disk - both partitions.
Partition manager uses e2fsck will all the right options to repair the missing inodes etc.

What is missing is a clean shutdown routine for the drives when the router is shutdown - I have tried manually to umount them before shutting the router down but cannot - i guess its because of the samba shares i have setup. My best guess at a clean shutdown would be to kill off any processes with locks on the drive and then umount however I have no idea how to do this.

wengi
01-12-2009, 12:23
Wow! This is a real old one :D

What version of firmware are you running?
The new firmware support scripts that can cleanly fsck, mount, umount aso.

Have a look in my howto.

wengi