Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 18 Dec 2014, 18:37
All times are UTC - 4
 Forum index » House Training » Users ( For the regulars )
How to recover corrupted text file / lost clusters- USB driv
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [22 Posts]   Goto page: 1, 2 Next
Author Message
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Mon 29 Oct 2012, 23:39    Post subject:  How to recover corrupted text file / lost clusters- USB driv  

Created/ edited a text file using geany. About 80k, Simple name (name.txt), on flash drive sdd1. pmount says sdd1 is 4005 mb vfat 3.7g/328m. Presumably the last number is the free space.

On trying to open this file, Geany and leafpad both give this error message: 'Failed to read from filename. Input/output error'.

Abiword shuts down, no message.

Fortunately, the Firefox (Nighttly) browser opened the file although it has been truncated so much work has been lost.

I pasted the contents into geany but when I tried to save to a copy of the file (filename2.txt) - it says 'Error opening filename: Read only file system. The file on disk may now be truncated. Changed name to filename3.txt and got same message.

Nightly won't save the file either. Tried saving another page - got a similar message:

'Filename could not be saved because the disk, folder or file is write-protected. Write-enable the disk and try again, or try saving in a different location.'

Tried saving to another flash drive with same result.


Geany did save to root/my-documents, after which it also saved to mnt/home (sdc1). The file is only 15k so over 60k disappeared somewhere.

Not sure what is happening - never happened before. But I'm beginning to wonder - since the truncation happened in the middle of a quoted paragraph from an online version of a newspaper, might there have been a buried code to protect copyright? Is this possible? or reasonable? It's a smallish regional newspaper and the file has been successfully saved and opened quite a few times since I pasted the quotation.

Another possibility is that yesterday, I was organizing bookmarks in Windows and exported them to an html file. Would it have overwritten the subject file? At some point i had tried to open the file with wordpad without success but can't remember the error message.

Does puppy have a scandisk function? Will it save lost clusters? Or maybe I should let windows try to recover? I'd really like to recover the lost work. Thanks in advance for any suggestions.

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN


Last edited by canbyte on Wed 31 Oct 2012, 17:21; edited 1 time in total
Back to top
View user's profile Send private message 
Barkin


Joined: 12 Aug 2011
Posts: 750

PostPosted: Tue 30 Oct 2012, 00:12    Post subject:  

canbyte wrote:
.. Does puppy have a scandisk function? Will it save lost clusters?


The recovery tools testdisk & photorec are available for puppy ...

http://www.murga-linux.com/puppy/viewtopic.php?t=79912

I'm not hopeful these tools would solve your problem, but they are useful to have anyway.
Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Tue 30 Oct 2012, 12:50    Post subject:  

Hi Barkin. It certainly sounds like it should recover whatever lost clusters are recoverable but I can't get it to start up so I'll post more details on the murga link you provided. Thanks.
_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN

Back to top
View user's profile Send private message 
Barkin


Joined: 12 Aug 2011
Posts: 750

PostPosted: Tue 30 Oct 2012, 13:31    Post subject:  

There is a page on TestDisk on the Puppy wiki which includes links to dependencies which must be present for it to work ... http://puppylinux.org/wikka/TestDisk
Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Tue 30 Oct 2012, 13:50    Post subject:  

Hi Barkin, sorry to be a noob but I don't know what a dependancy is or what to do about it.

I also see that sdd1 won't mount but pmount comes up and gives the option to (un)mount - which then produces an error message - unable to mount. So now I'm really concerned about losing everything on the drive. Ouch.

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN

Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3548
Location: West Lothian, Scotland, UK

PostPosted: Tue 30 Oct 2012, 16:17    Post subject:  

See...
Anyone know how to use ddrescue [NOT dd_rescue]?

You may be able to use ddrescue to clone from the suspect Flash Drive to a known good one [or any handy storage device?]
ddrescue uses its own code to DIRECTLY access the hardware.
Hence, when it hits trouble it doesn't crash the OS, just the ddrescue program, which is really easy to resume [it automatically resumes from where it crashed by using its log file].
Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Wed 31 Oct 2012, 11:55    Post subject:  

Well, Barkin will be happy I finally noticed that the link he gave contained a .pet file of slightly older version, so the dependency problem went away.

The post at the following link describes my effort to use testdisk to no avail although i stopped short of the write operation since I couldn't figure out the file choices and I didn't want to ruin any chances for later rescue.
http://www.murga-linux.com/puppy/viewtopic.php?t=79912&sid=37df96464b11d160459df2b6a3bcade6.

In trying to use Sylvander's suggested ddrescue, I've followed directions in the install file to the point it is unzipped but can't get the make command to work (from urxvt in ddrecover's directory) . Just says 'bash: make: command not found.'

I notice that the urxvt has a white background here whereas it had a black background when run by testdisk, which was one of my difficulties last evening (black on black).

Does bash use a different command for make or where am I going wrong?
Edit: I realized that the make command requires devx to operate - would need to dowload the sfs file and put in bootloader. Hoping to avoid all that.
Thanks.

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN


Last edited by canbyte on Wed 31 Oct 2012, 19:40; edited 1 time in total
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3548
Location: West Lothian, Scotland, UK

PostPosted: Wed 31 Oct 2012, 18:19    Post subject:  

canbyte wrote:
I've followed directions in the install file to the point it is unzipped but can't get the make command to work.

Why not just install the copy of ddrescue included in the Puppy Package Manager?
Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Wed 31 Oct 2012, 19:38    Post subject:  

I've just checked Slacko 533 package manager and no sign of any ddrescue in the list. Can you point me to the url it downloads from or what Puppy are you using? Thanks.

Edit; Search found a .pet here (v1.13)
http://www.murga-linux.com/puppy/viewtopic.php?t=33521

I downloaded and installed, now looking for how to run it (no menu entry), Found ddrescue (gear icon in /usr/bin.)

It is asking for source and destination and offering --help. Which I call up and realize I'm in way over my head.

What i suspect i'll get is rows and rows of block numbers, meaningless to me.
What I was hoping for was numerous files of lost clusters full of text that I (noob) would recognize and be able to piece together to recreate my original thoughts. Something like scandisk or chkdisk in windows.

fwiw, here is the output once it got working:
rescued 0B, errsize: 16384B, ipos 15360B, errors: 1, opos 15360B, Finished.
Log file had nothing in it.

any suggestions?

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN


Last edited by canbyte on Thu 01 Nov 2012, 12:50; edited 1 time in total
Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3548
Location: West Lothian, Scotland, UK

PostPosted: Thu 01 Nov 2012, 03:40    Post subject:  

1. See below a screenshot of the ddrescue version found [and I installed] in the list of repositories I chose within my Slacko-5.3.3.1-SCSI Puppy version.

2. I run it by typing a ddrescue command in a terminal.

3. Could you show here the command you used?
Use the commands I gave as a guide, but modify to suit your situation.
You need to specify the source [your problem Flash drive] and the destination [a 2nd Flash Drive?]

4. The output given by your ddrescue, and quoted by you:
(a) rescued 0B
This says that zero Bytes [0B] were rescued.
I'd need to know the command that produced that result.
Either the drive is faulty, and ddrescue was unable to rescue anything with a good command, or else the command was bad.
(b) errsize: 16384B
This shows that the error size was 16,384 Bytes [the total size of the Flash Drive?]
.
00.jpg
 Description   
 Filesize   12.19 KB
 Viewed   1084 Time(s)

00.jpg

Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Thu 01 Nov 2012, 12:46    Post subject:  

Hi Sylvander
I think my effort is going off the rails. Now I can't even get the package manager to come up. I click slickpet, go to more pets menu and click Puppy Package Manager (PPM). A brief orange box appears for a millisecond then is gone. Trying to access from the desktop menu - Setup/Setup Puppy/ P P M has the same effect. When i was able to access it last evening, I don't recall seeing the sceenshot you gave with the selection bullets across the top. I looked carefully at the choices available - no ddrescue. You have the 533-SCSI which may be different from my version which i think was just the standard 533?? However, my wife does have some uncomplimentary things to say about my ability to see what's in front of me!

Not sure what has caused PPM to malfunction but maybe I clicked on it too many times in my usual impatient modus operendi!! Any easy fix for that or do I have to re-install puppy from the beginning?

An old copy of the one important corrupted file turned up so I'm only missing a page or so in one project which could be recreated more or less. In addition, the aforesaid impatience got the better of me last evening and i tried letting windows xp try a recovery so I've probably erased whatever was left. Can't recall the name of the tool - something in accessories/system menu.

Anyway, I've run ddrescue again from a terminal in /usr/bin using command:
ddrescue -f -n /mnt/sde1 /mnt/sdc1/logfile

Note there is no space before the word logfile. Previous attempts with no '/' and a space did nothing. sde1 and sdc1 are mounted.

The output is the same as before so maybe the 16384b can be rescued. This would seem to be about the same size as the missing page of (plain) text. Dropping the -n produced the same output.

As all other files have now been backed up to DVD, I wonder if deleting all the files would allow ddrescue to concentrate on the problem instead of having to make a copy of everything?

Hopefully you can suggest something. Thanks again.

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN

Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3548
Location: West Lothian, Scotland, UK

PostPosted: Thu 01 Nov 2012, 16:42    Post subject:  

1. "I can't even get the package manager to come up"
Enter the command ppm in a terminal, and see if the terminal tells you what's causing the failure to run.

2. "I don't recall seeing the sceenshot you gave with the selection bullets across the top"
You would need to [as I did] configure the PPM, choosing the [maximum of 5] repo's to include in the list at top.
Those are the repo's that are searched when you search for a package [such as ddrescue].
My own search produced that single find of a version of ddrescue.

3. "I looked carefully at the choices available - no ddrescue"
You need to do a search.
In mine, I was asked which repo's I wanted to search, and chose to search all of the repo's [ALL were listed as one particular option].

4. "wife does have some uncomplimentary things to say about my ability to see what's in front of me! "
I have the same problem...
I call it "mind blindness"; the eyes see, but the mind does not comprehend that which is seen.

5. "Any easy fix for that or do I have to re-install puppy from the beginning?"
What I do:
(a) Use a Puppy FRUGAL install.
(b) Make backups of the pupsave at key points along the way, and restore the backup when necessary.
(c) Configure my Puppy so I can choose to NOT SAVE unless there is a good reason to do so.
Hence, nasties are discarded at shutdown/reboot, and the Puppy is as good at next boot as it was at this boot.

6. "I've run ddrescue again from a terminal in /usr/bin using command:
ddrescue -f -n /mnt/sde1 /mnt/sdc1/logfile"
(a) I'm no expert on the use of ddrescue, but I'll do my best to help.
(b) I believe /mnt is wrong;it aught to be /dev
Check whether /dev/sde is listed in your file manager.
This is the source device/DRIVE [not a mounted partition].
I suspect that ddrescue is unable to copy the contents of a drive which has its partition mounted.
I notice that I mention in the example I linked above that the [partition on] the source drive was unmounted.
I expect the destination drive had no partitions, so there was nothing available on that to be mounted.
---------------------------------------------------------------------------------------------------------
The PARTITION on the destination drive/device only appears [AS IF BY MAGIC!] on the Puppy desktop once the drive contents [partitions plus] have been copied [from source to destination].
---------------------------------------------------------------------------------------------------------
[Overwriting anything that was formerly on the drive; in my case nothing]
The fact that your partitions were mounted may be [one of the reasons] why your command fails.
I use Xfe, and my unmounted Flash drive is identified as sdb1, and /dev/sdb1 exists.
(c) /mnt/sdc1/logfile is WRONG!
It aught to be /dev/sdc [a storage device/drive named sdc, with a space between it and the logfile parameter.
What you have incorrectly specified is that the destination is to be a file named "logfile", inside the root folder of a mounted partition named sdc1.
Second reason why the command fails = you are attempting to copy a drive to a file.

Last edited by Sylvander on Fri 02 Nov 2012, 03:34; edited 1 time in total
Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Fri 02 Nov 2012, 01:29    Post subject:  

Hi Sylvander
I'll tackle the ppm issue tomorrow but I just tried modifying the terminal command as you suggested and it is certainly doing something different - more in line with expectations. What worked was unmounting the defective drive and mounting the destination drive:

ddrescue -f -n /dev/sde1 /dev/sdc1 logfile
Note the space and lack of / before 'logfile'

Results .
rescued 4004mb, errsize: 0b, errors: 0,
Rox filer found only garbage with no recognizable filenames and lots of gears and orange triangles with exclamation points in them. Not sure where to go with this but it hardly seems possible that the drive is going to be reconstructed.

Cheers

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN

Back to top
View user's profile Send private message 
Sylvander

Joined: 15 Dec 2008
Posts: 3548
Location: West Lothian, Scotland, UK

PostPosted: Fri 02 Nov 2012, 03:27    Post subject:  

1. Oops! Embarassed
[Please pardon my previous errors, I've now edited to ammend]
You said:
ddrescue -f -n /dev/sde1 /dev/sdc1 logfile

I think it should be:
ddrescue -f -n /dev/sde /dev/sdc logfile
...If you want to copy [the total contents of] one drive to the other.
The destination drive needs to be at least as big as the source, so it can take ALL of the contents coming from the source.
i.e. Partitioning, formatting, folders, files.
Back to top
View user's profile Send private message 
canbyte


Joined: 10 Jan 2009
Posts: 266
Location: Hamilton, Canada

PostPosted: Fri 02 Nov 2012, 11:10    Post subject:  

hi Sylvander
re ppm - the result from your suggestion:
**error**; gtkdialog: Error in line44, near token '</default>': syntax error
aborting...
I tried to find gtkdialog. Pfind found it in /usr/sbin but when I went to look, I found the /usr and /sbin directories but not /usr/sbin. Hmm. I don't really understand puppy filesystem sometimes. How can a whole subdirectory just disappear?

re ddrescue -
Oops not needed! You were right the first time - when I looked in /dev, I found sde1, sde2, sde3 even though sde is not partitioned. sdc goes up to 15, sdd and sde goes up to #8 so it looks like puppy was just anticipating what might be found.

To my surprise and delight, what looked like garbled garbage on the rox filer for the destination drive last night, looks perfectly fine this morning. !! This I discovered when puppy found and used a _save that had been transferred - correctly.

Alas, though, no extra file containing the missing pages/ clusters.

I do notice however, that in a directory called found.000, there are two files - file0000.chk (gear icon, 16k) and file001.chk (text icon, 96k, about the right size for my missing work). I can't open as text although I do recall opening it a few days ago and finding nothing. I now am confused as to whether this was put there by ddrescue or by testdisk (detailed on other thread linked above).

Going back a few posts, you mentioned Xfe. What's Xfe? Would it help to open file0001.chk?

Thanks again.

_________________
1. Dell Dimension E521, AMD Athln 64, 2 GHz 1.93GB ram,
Puppy 533 on CD, accesses flash drive only,
FFox Nightly12.0
2. Compaq P3 733Hz 375RAM
Printer: Oki C3400 > LAN

Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [22 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » Users ( For the regulars )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1026s ][ Queries: 13 (0.0055s) ][ GZIP on ]