PDA

View Full Version : Finding HDD on Knoppix



Jectson
12-08-2005, 12:31 AM
Hi,

I currently running Knoppix from a CD to recover some files from my hd. I usaly uses Windows, but it wont start up, and I need to backup some of my files.

After loading and starting Knoppix in firesave, only way that it would start, i cant find my hd. In root commandline I type fdisk /dev/hda and it says The number of cylinders for this disk is set to 4864. etc etc etc. So it seems like its abel to accees the hd, but how can I find the files on it?In the Storage Media folder, it can only find CDROM and Floppy.

Please help me, how can I find hd?

Sorry about the bad english,
Best Regards.
Sondre

eon
12-08-2005, 04:48 AM
Basically you need to mount the filesystem. You need to become root so

su then
mkdir /mnt/hda This assumes windows has your entire hard drive. If that isn't the case you will need to determine your partitions.
If windows has the whole drive then:
mount -t vfat /dev/hda /mnt/hda

cd /mnt/hda your files should be there. Hope that helps.

Jectson
12-08-2005, 07:26 PM
Basically you need to mount the filesystem. You need to become root so

su then
mkdir /mnt/hda This assumes windows has your entire hard drive. If that isn't the case you will need to determine your partitions.
If windows has the whole drive then:
mount -t vfat /dev/hda /mnt/hda

cd /mnt/hda your files should be there. Hope that helps.

Thanks for helping. I tryed to do this. I was able to make the /mnt/hda, but when Im trying to the the mount -t vfat /dev/hda /mnt/hda I get this message:
wrong fs type, bad option, bad superblock on /dev/hda, missing codepage or other error. In some cases useful info is found in syslog - try dmesg tail or so.

What shoud Ido? thanks

rwcitek
12-09-2005, 04:21 PM
In root commandline I type fdisk /dev/hda and it says The number of cylinders for this disk is set to 4864. etc etc etc. So it seems like its abel to accees the hd, but how can I find the files on it?
Open a terminal window and type the following:


( set -x
cat /etc/knoppix-version
cat /proc/partitions
sudo fdisk -l /dev/hd?
cat /etc/fstab
ls -la /mnt/
mount
df -Hl
) &> result.txt
Please post the output from result.txt

Regards,
- Robert
http://www.cwelug.org

Jectson
12-09-2005, 06:55 PM
In root commandline I type fdisk /dev/hda and it says The number of cylinders for this disk is set to 4864. etc etc etc. So it seems like its abel to accees the hd, but how can I find the files on it?
Open a terminal window and type the following:


( set -x
cat /etc/knoppix-version
cat /proc/partitions
sudo fdisk -l /dev/hd?
cat /etc/fstab
ls -la /mnt/
mount
df -Hl
) &> result.txt
Please post the output from result.txt

Regards,
- Robert
http://www.cwelug.org

Result.txt turned out empty, so Im posting what i got in the terminal windows on each command:


cat /etc/knoppix-version
+ cat /etc/knoppix-version
3.9 2005-05-27


cat /proc/partitions
+ cat /proc/partitions
major minor #blocks name

3 0 39070080 hda
3 1 39062016 hda1
240 0 1966656 cloop0


sudo fdisk -l /dev/hd?
+ sudo fdisk -1 /dev/hda /dev/hdb /dev/hdc /dev/hdd /dev/hde /dev/hdf /dev/hdg /dev/hdh
fdisk: invalid option -- 1

Usage: fdisk [-b SSZ] [-u] DISK Change partition table
fdisk -l [-b SSZ] [-u] DISK List partition table(s)
fdisk -s PARTITION Give partition size(s) in blocks
fdisk -v Give fdisk version
Here DISK is something like /dev/hdb or /dev/sda
and PARTITION is something like /dev/hda7
-u: give Start and End in sector (instead of cylinder) units
-b 2048: (for certain MO disks) use 2048-byte sectors


cat /etc/fstab
+ cat /etc/fstab
/proc /proc proc defaults 0 0
/sys /sys sysfs noauto 0 0
/dev/pts /dev/pts devpts mode=0622 0 0
/dev/fd0 /mnt/auto/floppy auto user,noauto,exec,umask=000 0 0
/dev/cdrom /mnt/auto/cdrom auto user,noauto,exec,ro 0 0


ls -la /mnt/
+ ls --color=auto -la /mnt
total 3
drwxr-xr-x 4 root root 1024 Dec 8 19:16 .
drwxr-xr-x 9 root root 1024 Dec 7 23:37 ..
drwxr-xr-x 2 root root 0 Dec 9 18:41 auto
lrwxrwxrwx 1 root root 15 Dec 7 22:32 cdrom -> /mnt/auto/cdrom
lrwxrwxrwx 1 root root 16 Dec 7 22:32 floppy -> /mnt/auto/floppy
drwxr-xr-x 2 root root 1024 Dec 8 19:16 hda


mount
+ mount
/dev/root on / type ext2 (rw)
/dev/hdc on /cdrom type iso9660 (ro)
/dev/cloop on /KNOPPIX type iso9660 (ro)
/ramdisk on /ramdisk type tmpfs (rw,size=396372k)
/UNIONFS on /UNIONFS type unionfs (rw,noatime,dirs=/ramdisk=rw:/KNOPPIX=ro)
/UNIONFS/dev/pts on /UNIONFS/dev/pts type devpts (rw)
automount(pid1663) on /mnt/auto type autofs (rw,fd=4,pgrp=1663,minproto=2,maxproto=4)


df -Hl
+ df -hl
Filesystem Size Used Avail Use% Mounted on
/dev/root 3.4M 13K 3.4M 1% /
/dev/hdc 696M 696M 0 100% /cdrom
/dev/cloop 1.9G 1.9G 0 100% /KNOPPIX
/ramdisk 388M 9.9M 378M 3% /ramdisk
/UNIONFS 2.3G 1.9G 378M 84% /UNIONFS


Thanks, Jectson

rwcitek
12-09-2005, 09:06 PM
Result.txt turned out empty,
I wonder if it's becaue you missed typing in the opening (left) parenthesis before the "set -x" command? That's what happens to me most often. Any suggestion on how I can make that parenthesis more obvious? One thought I had was to put a "true" command before it, like so:

true ; ( set -x
...
"true" does not do anything, but it would make the "(" stand out. Any other ideas?



cat /proc/partitions
+ cat /proc/partitions
major minor #blocks name

3 0 39070080 hda
3 1 39062016 hda1
240 0 1966656 cloop0

OK. So you have a 40 GB drive (/dev/hda) with a single partition on it (/dev/hda1).



sudo fdisk -l /dev/hd?
+ sudo fdisk -1 /dev/hda /dev/hdb /dev/hdc /dev/hdd /dev/hde /dev/hdf /dev/hdg /dev/hdh
fdisk: invalid option -- 1

Usage: fdisk [-b SSZ] [-u] DISK Change partition table
fdisk -l [-b SSZ] [-u] DISK List partition table(s)
fdisk -s PARTITION Give partition size(s) in blocks
fdisk -v Give fdisk version
Here DISK is something like /dev/hdb or /dev/sda
and PARTITION is something like /dev/hda7
-u: give Start and End in sector (instead of cylinder) units
-b 2048: (for certain MO disks) use 2048-byte sectors

Ah, yes. Another common error: mistaking l (letter L) for 1 (number one). Again, any suggestion on how to make it more clear that the option should be an "l" and not a "1"? One thought I had was to use this alternative:

fdisk -$'\154' /dev/hd?
Again, I'm open to suggestions and improvements.

As to your specific issue, Knoppix has no problem seeing your harddrive (/dev/hda) and has no problem reading the partition table to see that there is a single partition (/dev/hda1). However, because there is no entry for that partition in /etc/fstab, I suspect that Knoppix cannot determine what type of filesystem it is. That may be because the filesystem is damaged or otherwise obfuscated.

To have Knoppix tell us what's happening, open a terminal window and type (or cut-and-paste) this into it:

sudo dmesg -c &> /dev/null
true ; ( set -x
sudo fdisk -$'\154' /dev/hda
sudo mkdir /mnt/hda1
sudo mount /dev/hda1 /mnt/hda1
dmesg
) &> result.txt

Please post the output from result.txt

Regards,
- Robert
http://www.cwelug.org

Jectson
12-09-2005, 09:24 PM
Now it worked out with the result.txt file. The input from the file is:


+ sudo fdisk -l /dev/hda

Disk /dev/hda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 4863 39062016 7 HPFS/NTFS
+ sudo mkdir /mnt/hda1
+ sudo mount /dev/hda1 /mnt/hda1
+ dmesg
NTFS volume version 3.1.


Thanks,
Jectson

rwcitek
12-10-2005, 03:04 AM
Now it worked out with the result.txt file.
Everything looks good. You should now be able to do this:

sudo ls -la /mnt/hda1
Let us know if that works.

Regards,
- Robert
http://www.cwelug.org

Jectson
12-10-2005, 01:09 PM
Now it worked out with the result.txt file.
Everything looks good. You should now be able to do this:

sudo ls -la /mnt/hda1
Let us know if that works.

Regards,
- Robert
http://www.cwelug.org

It looks good now! When I typed
ls -la /mnt/hda1 it listed up all the files in C: in windows. Only one problem now. hda1 is a locked folder, and when I try to accsses it, I get "premission denied". Any suggestions?

If I use root shell, then Iam able to access it. But Ill have to be able to access it from network so that I can copy the files.

rwcitek
12-10-2005, 05:13 PM
It looks good now! When I typed
ls -la /mnt/hda1 it listed up all the files in C: in windows. Only one problem now. hda1 is a locked folder, and when I try to accsses it, I get "premission denied". Any suggestions?
The way Knoppix works all of the commands that you typed should have happend automatically. My recommendation would be to reboot using the Knoppix CD and then try mounting the partition. That is, after reboot type this:

mount /mnt/hda1

Alternatively, undo everything you've done so far and then have Knoppix figure the mounting out. Specifically, type (or cut-and-paste) these commands into a terminal window:

dmesg -c >& /dev/null
true ; ( set -x
sudo umount /mnt/hda*
sudo rmdir /mnt/hda*
sudo rebuildfstab -r
cat /etc/fstab
ls -la /mnt/
mount /mnt/hda1
ls -la /mnt/hda1
dmesg
) >& result.txt

Please post the output from result.txt.

Regards,
- Robert
http://www.cwelug.org