PDA

View Full Version : Basic help recovering files off bad hard drive



Ansky926
04-04-2011, 10:39 PM
I'm a novice Knoppix user and I'm trying to recover files off a Windows XP hard drive where the OS has failed. I had been successful in recovering files before, but it has taken me a while to try several ways to get it right and it has been a while since I've done this.

I'm trying to recover a user's personal folder from the hard drive to an external USB hard drive. I boot up to Knoppix and I can see three hard drives. One is the partitioned recovery HD and then the HD with the files I'm trying to recover. The other HD is the external USB drive.

I have gone into the properties of each drive and given them read/write permissions. If I try to change the permissions on the folders I'm trying to copy from and to I get the error "Could not change permissions for /mnt/uba1/recover". If I copy the folder I'm trying to move, in this case iTunes, to the external USB I get errors like "could not make folder mnt/uba1/itunes".

The files I'm looking to recover are on hda2 and I'm trying to move to a folder I created on the USB drive UBA1. From the hda2 drive I'm trying to recover this directory: /Documents and Settings/Owner/My Documents/My Music/iTunes. I'm trying to move them to the UBA1 to a folder named "recover".

Am I missing permission settings, is there a command that I can run that makes this easier?

Ansky926
04-06-2011, 06:15 PM
I should also add that I have unchecked the "Read Only" for the drive I'm trying to move the files to. The drive is mounted.

krishna.murphy
04-07-2011, 02:46 AM
What version of Knoppix are you using? Version 6 mounts drives writable in most cases, while earlier versions did not. I believe in version 5 you had to click the icon to mount it, then right-click and set it writable.

Cheers!
Krishna :mrgreen:

Forester
04-07-2011, 11:26 AM
What version of Knoppix are you using?

My thought exactly. I think Ansky926 has an old Knoppix 5 CD.

I think all he wants to do is drag 'n' drop a folder (aka directory) from his hard drive to his USB drive.

That would be with this pcmanfm that folks are always talking about ? Under Knoppix 6 sure but under Knoppix 5 I think you'd use Konqueror. How hard can that be ? Command line man myself so I really don't know.

The devices have to be mounted first. Can you do that from pcmanfm ? (doubt it). It is easy enough ... open a terminal and type:



mount /media/sda2 # Ansky926's Windoze partition
mount /media/sdb1 # Ansky926's USB partition
My guess is something very similar would work under Knoppix 5 but the Windows partition probably does get mounted under /mnt/hda2. I've never known USB sticks get mounted anywhere other than /media but I never used Knoppix 5 all that much.

Knoppix 5 (and earlier) had a nice set of icons representing disk partitions on the desktop and you could (didn't have to) mount partitions by clicking on them. That's gone from Knoppix 6. I guess that UFD partitions could be mounted the same way.

Knoppix 5 (and earlier) could not mount NTFS partitions r/w so there is no point trying to make the mount read/write. It might let you do this but it has no real effect. So you can copy, but not move, files off a Windoze Ex drive. I don't quite understand why to 'recover' files from a duff disk you would move rather than copy them but perhaps it involves fewer mouse clicks. Save the planet and all that.

I can't see why the mount of the USB stick would be by default read/only but Ansky926 writes that he has unchecked the "read-only" (which I guess is an indication that he's using a wimpy UI and not a CLI).

So he writes he can't copy. The copy command under Linux is cp. Ansky926 doesn't say he using something else so I gave it a go:



@Microknoppix:~$ cp -R tmp mnt/uba1/itunes
cp: cannot create directory `mnt/uba1/itunes': No such file or directory
Note the error message says directory but Ansky926 writes that the error message he gets says folder. I am not aware of Knoppix having a special en-windows locale so I guess he's not using cp. My guess is he is using some drap-n-drop. In which case how did Ansky926 manage to leave off the leading /?

My real question is how does one help such people ? No wonder questions at this level are usually ignored by regular forum readers.

Cheers :mrgreen:

Werner P. Schulz
04-07-2011, 04:57 PM
From the hda2 drive I'm trying to recover this directory: /Documents and Settings/Owner/My Documents/My Music/iTunes. I'm trying to move them to the UBA1 to a folder named "recover".

Am I missing permission settings, is there a command that I can run that makes this easier?... I hope you are not using some very old Knoppix-Version.

Open PCManFM twice. In the first instance of PCManFM select whatever you want to copy to the usb-drive. In the socond instance of PCManFM select the usb-drive - here you must be root! (PCManFM-menu/ Tools/ Open current folder as root).


Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.4.4 remaster)

krishna.murphy
04-07-2011, 06:19 PM
PCManFM-menu/ Tools/ Open current folder as root
Why is it imperative to "take root"? That seems an odd way for things to be set up.

Cheers!
Krishna :mrgreen:

Werner P. Schulz
04-07-2011, 06:45 PM
Why is it imperative to "take root"? That seems an odd way for things to be set up.


... you are right! It also works for simple user knoppix - just tested it for my own,

Werner P. Schulz
04-07-2011, 07:14 PM
... oh! I have make a mistake - it doesn't work for user "knoppix"; I tested at the wrong location :-(

On extern usb-drive I can not work as user knoppix. Either i work in the second instance of PCManFM as root or root creates a storage folder and "chown" it for user knoppix.

I think, the first way is easier to use for knoppix novice.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.4.4 remaster)

Forester
04-07-2011, 08:42 PM
Why is it imperative to "take root"? That seems an odd way for things to be set up.


My thought exactly.

So I stuck in a USB stick and Knoppix added the following line to /etc/fstab:


/dev/sdc1 /media/sdc1 vfat noauto,users,exec,umask=000,shortname=winnt,uid=kn oppix,gid=knoppix 0 0 So I typed in (look Mum, no sudo):


mount /media/sdc1
fgrep sdc1 /etc/fstab
and got:


/dev/sdc1 /media/sdc1 vfat rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0 000,dmask=0000,allow_utime=0022,codepage=cp850,ioc harset=iso8859-1,shortname=winnt,errors-remount-ro 0 0
Taking the letters rw as a good sign, I tried (without sudo):


touch /media/sdc1/werner
rm /media/sdc1/wernerand got no error. So I did:


pcmanfm &
pcmanfm &and dragged and dropped arbitrary file from my the file manager open at my home directory to the file manager open on the usb top-level directory and again got no error. I deleted the file again using the file manger and again no error. I opened nothing as a root window.

What have I got wrong ? Installing to USB ? Using the DVD edition ? Running the KDE desktop instead of the latest toy ? Or did I just cheat by using the command line ?

Every release the GUI seems to change and people are all lost, confused or frustrated because the hack they used to use no longer works. Here's me typing in the same kind of thing I did 30 years ago (before there were PCs and stuff) and, "well, knock me down with a feather", it still works.

Cheers, :mrgreen:

Werner P. Schulz
04-07-2011, 09:55 PM
What have I got wrong ? Installing to USB ? Using the DVD edition ? Running the KDE desktop instead of the latest toy ? Or did I just cheat by using the command line ?
... I found the difference - my usb-drive is ext3-formatted.

I attached an external usb-drive and found in /etc/fstab

# Added by KNOPPIX
/dev/sdd2 /media/sdd2 ext3 noauto,users,exec 0 0
In this case user "knoppix" get error message "Permission denied" if he wants to create files or folders on this partition.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.4.4 remaster)

Forester
04-07-2011, 10:16 PM
... I found the difference - my usb-drive is ext3-formatted.


Ah ha ! That would make a difference.

But ... the line in /etc/fstab has users so the user knoppix can mount the drive without using sudo. No ?

So it comes down to the formatting. When you create your ext3 file system you've just the top level directory and the lost+found directory, both owned by root so only root can create files in there. It's a cat: one way of killing it is:


sudo chown knoppix:knoppix /media/sdd2and the user knoppix can now create files and folders on the USB drive just as he can in any other directory the user owns. And you only need to do that once.

I guess Ansky926 probably has (and probably should have for rescue) a USB stick with a vfat partition so he shouldn't need root at all and shouldn't need to change permissions or ownerships and stuff but you never know.

Werner P. Schulz
04-07-2011, 10:59 PM
But ... the line in /etc/fstab has users so the user knoppix can mount the drive without using sudo. No ?Yes and No!

If I attach the usb-drive, KNOPPIX (6.4.4) creates the entry in /etc/fstab and mounts the partition automatic. No need to click on an icon in PCManFM or writing "mount /media/sdd2" in the terminal. But then user knoppix can umount and remount the partition.

Greetings Werner * http://www.wp-schulz.de/knoppix/summary.html
Own Rescue-CD with Knoppix (Knoppix V6.4.4 remaster)

Forester
04-08-2011, 12:09 AM
Yes and No!


I can agree with that bit.

With me, neither df or /etc/mtab show the USB partition being mounted (automatically). That's consistent with the noauto in the line added to /etc/fstab. When I start pcmanfm I've got two panes. The left hand one has a list of 'icons' with names line knoppix, Desktop, Applications, cloop, loop0, STORE N GO (that the USB's volume label), var, usr, home, root (those are the labels of partitions on my hard drive), dm-1, dm-2, ,,, (lvm volumes on my hard drive), knoppixwork, knoppixdata, knoppixboot (the partitions on my Knoppix USB and yes, two of those are ext3).

If I click on the STORE N GO, the right hand pane shows the folders and files in the USB stick and now df and /etc/mtab show the USB partition as mounted. I think the entries in /etc/ftab allows pcmanfm to mount partitions on-demand.

You didn't click on any icon. So what do you call the pictures in the list in the left hand pane ?

Werner P. Schulz
04-08-2011, 09:05 PM
... now I've done a deeper look to my testing results from yesterday. I found in my remastered Knoppix version in PCmanFM-menu at 'Preferences/ Volume Management' settings, which are not the default setting.

But I can't remenber at what time I changed the settings and why. Old age and forgetfulnes.