LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-12-2012, 01:42 PM   #1
okorkie
Member
 
Registered: Mar 2007
Posts: 31

Rep: Reputation: 0
Need help recovering files from old hard drive with Fedora Core installation


Hello everyone,

I have an internal SATA hard drive that I'm attempting to recover files from (mp3's, jpeg's, etc) and I'm wondering if it has been corrupted? Here is how I'm attempting to recover:

- I have a Linux Live CD running on a Windows 7 laptop and my SATA drive is connected to the laptop via USB to SATA adapter. When I list the contents of the HD, here is what I see:

# df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 995M 5.6M 989M 1% /initrd/pup_rw
tmpfs 110M 109M 1000K 100% /initrd/mnt/tmpfs
/dev/loop0 109M 109M 0 100% /initrd/pup_ro2
unionfs 995M 5.6M 989M 1% /
shmfs 466M 0 466M 0% /dev/shm
/dev/sda1 100M 25M 76M 25% /mnt/sda1
/dev/sda2 125G 22G 103G 18% /mnt/sda2
/dev/sda3 25G 14G 11G 57% /mnt/sda3
/dev/sdb1 190M 30M 151M 17% /mnt/sdb1 <== this is my 300GB HD
#
#
# cd /mnt/sdb1
#
#
# ls -la
total 23858
drwxr-xr-x 5 root root 1024 2009-12-15 01:22 .
drwxr-xr-x 16 root root 140 2012-06-12 10:39 ..
-rw-r--r-- 1 root root 85102 2009-02-24 02:11 config-2.6.27.19-170.2.35.fc10.x86_64
-rw-r--r-- 1 root root 85237 2009-06-22 06:48 config-2.6.27.25-170.2.72.fc10.x86_64
-rw-r--r-- 1 root root 85186 2009-12-10 23:45 config-2.6.27.41-170.2.117.fc10.x86_64
drwxr-xr-x 3 root root 1024 2008-12-05 00:27 efi
drwxr-xr-x 2 root root 1024 2009-12-15 01:22 grub
-rw------- 1 root root 3953246 2009-03-24 23:38 initrd-2.6.27.19-170.2.35.fc10.x86_64.img
-rw------- 1 root root 3953733 2009-07-21 23:47 initrd-2.6.27.25-170.2.72.fc10.x86_64.img
-rw------- 1 root root 3955867 2009-12-15 01:12 initrd-2.6.27.41-170.2.117.fc10.x86_64.img
drwx------ 2 root root 12288 2008-12-05 00:22 lost+found
-rw-r--r-- 1 root root 1407668 2009-02-24 02:11 System.map-2.6.27.19-170.2.35.fc10.x86_64
-rw-r--r-- 1 root root 1409926 2009-06-22 06:48 System.map-2.6.27.25-170.2.72.fc10.x86_64
-rw-r--r-- 1 root root 1410365 2009-12-10 23:45 System.map-2.6.27.41-170.2.117.fc10.x86_64
-rwxr-xr-x 1 root root 2642624 2009-02-24 02:11 vmlinuz-2.6.27.19-170.2.35.fc10.x86_64
-rwxr-xr-x 1 root root 2643968 2009-06-22 06:48 vmlinuz-2.6.27.25-170.2.72.fc10.x86_64
-rwxr-xr-x 1 root root 2645568 2009-12-10 23:45 vmlinuz-2.6.27.41-170.2.117.fc10.x86_64

The HD is /dev/sdb1 and lists the capacity as 190M, but in reality it is a 300GB.

Is there any other commands I can run to explore, mount, etc the contents of the HD?

Thanks in advance!
 
Old 06-12-2012, 02:05 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
As root: umount /mnt/sdb1; fdisk -l /dev/sdb # and if you have it (KNOPPIX Live CD?): disktype /dev/sdb.
 
Old 06-12-2012, 05:03 PM   #3
okorkie
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 0
I'm using Puppy Linux and here is the output:

# umount /mnt/sdb1
# fdisk -l /dev/sdb

Disk /dev/sdb: 300.1 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders, total 586114704 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d67c8

Device Boot Start End Blocks Id System
/dev/sdb1 * 63 401624 200781 83 Linux
/dev/sdb2 401625 586099394 292848885 8e Linux LVM
# disktype /dev/sdb

--- /dev/sdb
Block device, size 279.5 GiB (300090728448 bytes)
GRUB boot loader, compat version 3.2, boot drive 0x80
DOS/MBR partition map
Partition 1: 196.1 MiB (205599744 bytes, 401562 sectors from 63, bootable)
Type 0x83 (Linux)
Ext3 file system
Volume name "/boot"
UUID 7B3752BF-B366-4336-8E5F-902FE34F45D2 (DCE, v4)
Last mounted at "/run/media/liveuser/_boot"
Volume size 196.1 MiB (205598720 bytes, 200780 blocks of 1 KiB)
Partition 2: 279.3 GiB (299877258240 bytes, 585697770 sectors from 401625)
Type 0x8E (Linux LVM)
Linux LVM2 volume, version 001
LABELONE label at sector 1
PV UUID UhBsNw-t1ut-r0UZ-EWV1-MrOz-IAXP-6iNKjc
Volume size 279.3 GiB (299877258240 bytes)
Meta-data version 1
 
Old 06-12-2012, 07:03 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Quote:
Originally Posted by okorkie View Post
Code:
Partition 2: 279.3 GiB (299877258240 bytes, 585697770 sectors from 401625)
  Type 0x8E (Linux LVM)
  Linux LVM2 volume, version 001
As root try 'pvscan; vgscan; vgchange -ay'. After that run 'lvscan; dmsetup status'. You now should see the regular partitions to mount else post these commands output.
 
Old 06-12-2012, 07:12 PM   #5
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,622

Rep: Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577
Does Puppy Linux have support for Logical Volume Management (LVM2)? Looking around on the Web, I can't find anything to suggest that it does, and that's what you're going to need to look inside that sdb2 partition, which is where everything except the boot files resides.
 
Old 06-13-2012, 10:17 AM   #6
okorkie
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 0
Ok, I switched from a Live Puppy Linux CD to Fedora 17 Live CD. Here is the output:

[root@localhost ~]# fdisk -l /dev/sdb

Disk /dev/sdb: 300.1 GB, 300090728448 bytes
255 heads, 63 sectors/track, 36483 cylinders, total 586114704 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d67c8

Device Boot Start End Blocks Id System
/dev/sdb1 * 63 401624 200781 83 Linux
/dev/sdb2 401625 586099394 292848885 8e Linux LVM
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# disktype /dev/sdb
bash: disktype: command not found...

[root@localhost ~]#
[root@localhost ~]# pvscan
PV /dev/sdb2 VG VolGroup00 lvm2 [279.28 GiB / 32.00 MiB free]
Total: 1 [279.28 GiB] / in use: 1 [279.28 GiB] / in no VG: 0 [0 ]
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "VolGroup00" using metadata type lvm2
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# vgchange -ay
2 logical volume(s) in volume group "VolGroup00" now active
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# lvscan
ACTIVE '/dev/VolGroup00/LogVol00' [277.28 GiB] inherit
ACTIVE '/dev/VolGroup00/LogVol01' [1.97 GiB] inherit
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# dmsetup status
live-osimg-min: 0 8388608 snapshot 2448/2448 24
VolGroup00-LogVol01: 0 4128768 linear
live-rw: 0 8388608 snapshot 19504/1048576 88
VolGroup00-LogVol00: 0 581500928 linear

From this output, what do I need to do next in order to access the files from the HD?

Thanks
 
Old 06-13-2012, 11:43 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
You mount them somewhere:
mkdir /media/LogVol00; mount /dev/VolGroup00/LogVol00 -t auto /media/LogVol00
mkdir /media/LogVol01; mount /dev/VolGroup00/LogVol01 -t auto /media/LogVol01
 
Old 06-13-2012, 01:38 PM   #8
okorkie
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 0
Unfortunately I receive the following error when attempting to mount:

[root@localhost ~]# mkdir /media/LogVol00
[root@localhost ~]# mount /dev/VolGroup00/LogVol00 -t auto /media/LogVol00/
mount: wrong fs type, bad option, bad superblock on /dev/mapper/VolGroup00-LogVol00,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
 
Old 06-13-2012, 03:39 PM   #9
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,477

Rep: Reputation: Disabled
Did you try the dmesg | tail command as suggested?

I've just used System Rescue CD to access the LVM volumes on a disk from a CentOS system (which is RHEL based). I did the following:
  • Connected the hard drive and booted the system from the CD
  • Ran pvscan, vgscan, vgchange -ay and lvscan
  • Created an empty directory (mkdir /mnt/tempdir)
  • Mounted the volume with mount /dev/VolGroup00/LogVol00 /mnt/tempdir (the -t option was not required as "auto" is the default)
I could then view and access the files in /mnt/tempdir.

In order for this to work, the live CD you're using must support both LVM and the file system on the logical volume. My preference for System Rescue CD stems from the fact that it contains a lot of useful software, has a very feature-complete kernel, and is frequently updated.
 
Old 06-13-2012, 03:51 PM   #10
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,622

Rep: Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577Reputation: 1577
Other useful information can be obtained by running:
Code:
file -s /dev/VolGroup00/LogVol*
 
Old 06-14-2012, 01:24 PM   #11
okorkie
Member
 
Registered: Mar 2007
Posts: 31

Original Poster
Rep: Reputation: 0
Thanks everyone for all the help... I was able to figure this out. Once I have pulled all my files off my HD, I will re-install with Mint Linux.

Cheers
 
Old 06-14-2012, 02:47 PM   #12
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,361
Blog Entries: 55

Rep: Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547Reputation: 3547
Quote:
Originally Posted by okorkie View Post
Thanks everyone for all the help... I was able to figure this out.
The best way to reward for getting help instead of saying "thanks" would be you posting the actual commands you used.
That way you can help others that find this thread. This is called reciprosity and it's one of the things LQ thrives on.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Recovering files from a filevault-ed OS X hard drive? ichbindaswalros Linux - Software 6 02-21-2011 04:27 AM
How to migrate Fedora Core 5 installation to a new hard drive using LVM? SparceMatrix Linux - Hardware 6 05-06-2006 11:59 AM
Windows installation cant see the whole hard drive after Fedora Core fratkiller General 1 10-08-2005 09:34 PM
Problem in Fedora Core 2 Hard Drive installation raysonpak Linux - Newbie 0 05-25-2004 12:18 PM
Recovering Hard Drive files CycloLink Linux - Hardware 6 01-29-2004 08:59 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration