LinuxQuestions.org
Visit Jeremy's Blog.
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 12-23-2013, 06:01 PM   #1
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Rep: Reputation: 42
mount backed up partition


Hello All,

My issue is, I backed up my entire hard drive with dd command and it is backup.img, I tried mounting the the image and retrieving the backup files with no luck on this forum here.

I since , got a hard drive, and restored the .img file to the entire hard drive.So I now have the following:


Disk /dev/sdb: 80.0 GB, 80000000000 bytes
240 heads, 63 sectors/track, 10333 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x48d97f5e

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 14 105808+ 83 Linux
/dev/sdb2 15 7752 58499280 8e Linux LVM

So I tried mount the boot partition but it failed , and so I ran fsck on it and it fixed any errors and now the sdb1 is mountable.

[root@livedvd centoslive]# fsck.ext3 -y -f /dev/sdb1
e2fsck 1.41.12 (17-May-2010)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/boot: 59/26520 files (25.4% non-contiguous), 41305/105808 blocks

But my files are on /dev/sdb2 and sdb2 is unmountable because it is not ext3,ext2 filesystem.

[root@livedvd centoslive]# mount -t ext3 /dev/sdb2 /mnt/testt/
mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
i915 0000:00:02.0: VGA-1: EDID block 0 invalid.
EXT3-fs (sdb2): error: can't find ext3 filesystem on dev sdb2.
EXT3-fs (sdb2): error: can't find ext3 filesystem on dev sdb2.


so my question is, how do I mount that lvm partition?

When I try to boot the hard drive, there is a kernel panic.

Last edited by cbtshare; 12-23-2013 at 06:02 PM.
 
Old 12-23-2013, 07:08 PM   #2
kinneyd
LQ Newbie
 
Registered: Oct 2011
Posts: 21

Rep: Reputation: Disabled
You'll have to mount the logical volume. See if the system recognizes the volume group on sdb2. Do the following commands produce any output?

# vgs
# lvs

Last edited by kinneyd; 12-23-2013 at 07:08 PM. Reason: Clarification
 
Old 12-24-2013, 12:49 AM   #3
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42
OH..forgot to mention that as well.I did lvscan and vgscan , and nothing came up.So this is why I'm at a loss
 
Old 12-24-2013, 02:56 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,033

Rep: Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912Reputation: 1912
You need to activate them first - try
Code:
vgchange -a y
 
Old 12-24-2013, 05:33 AM   #5
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42
I thought you would see the volume groups when you did vgs, and then you activate them.I will try running that command and update the thread.\

Thank you
 
Old 12-24-2013, 01:32 PM   #6
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42
just what I thought..

[root@livedvd centoslive]# vgchange -a y
No volume groups found

any more ideas on how to handle this?
 
Old 12-24-2013, 03:21 PM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,116

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
What does "file -s /dev/sdb2" say is actually on that partition?

By any chance, is there a "filter =" line in /etc/lvm/lvm.conf that would keep vgscan from looking at /dev/sdb2?

Last edited by rknichols; 12-24-2013 at 03:26 PM. Reason: Add mention of filter line
 
Old 12-29-2013, 05:16 PM   #8
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42
Thank you for your assistance, and sorry for the late reply..

Result:

file -s /dev/sdb1
/dev/sdb1: Linux rev 1.0 ext3 filesystem data

file -s /dev/sdb2
/dev/sdb2: data

I also do not have any such filter.

Code:
    # By default we accept every block device:
    wfilter = [ "a/.*/" ]

    # Exclude the cdrom drive
    # filter = [ "r|/dev/cdrom|" ]

    # When testing I like to work with just loopback devices:
    # filter = [ "a/loop/", "r/.*/" ]

    # Or maybe all loops and ide drives except hdc:
    # filter =[ "a|loop|", "r|/dev/hdc|", "a|/dev/ide|", "r|.*|" ]

    # Use anchors if you want to be really specific
    # filter = [ "a|^/dev/hda8$|", "r/.*/" ]

    # The results of the filtering are cached on disk to avoid
    # rescanning dud devices (which can take a very long time).
    # By default this cache is stored in the /etc/lvm/cache directory
    # in a file called '.cache'.
    # It is safe to delete the contents: the tools regenerate it.
    # (The old setting 'cache' is still respected if neither of
    # these new ones is present.)
    cache_dir = "/etc/lvm/cache"
    cache_file_prefix = ""

Last edited by cbtshare; 12-29-2013 at 05:21 PM.
 
Old 12-30-2013, 10:16 AM   #9
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,116

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Quote:
Originally Posted by cbtshare View Post
file -s /dev/sdb2
/dev/sdb2: data
That says that /dev/sdb2 is just unrecognizable data and does not have an LVM physical volume header, e.g.,
Code:
/dev/sda10: LVM2 (Linux Logical Volume Manager) , UUID: F3fL1lvHhMqdT92QK4oeZUAN3m1owI1
. What do you see from
Code:
hexdump -C /dev/sdb2 | head -20
 
Old 12-30-2013, 08:34 PM   #10
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42
This is the output :

hexdump -C /dev/sdb2 | head -20
Code:
00000000  00 00 00 00 00 00 00 00  02 80 00 00 00 00 00 00  |................|
00000010  4c 45 53 00 48 43 53 41  00 61 72 5f 46 49 4c 45  |LES.HCSA.ar_FILE|
00000020  53 00 30 31 31 00 00 00  00 00 00 00 00 00 00 00  |S.011...........|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00001000  00 00 00 00 00 00 00 00  02 80 00 00 00 00 00 00  |................|
00001010  4c 45 53 00 48 43 53 41  00 61 72 5f 46 49 4c 45  |LES.HCSA.ar_FILE|
00001020  53 00 30 31 31 00 00 00  00 00 00 00 00 00 00 00  |S.011...........|
00001030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00002000  00 00 00 00 00 00 00 00  02 80 00 00 00 00 00 00  |................|
00002010  4c 45 53 00 48 43 53 41  00 61 72 5f 46 49 4c 45  |LES.HCSA.ar_FILE|
00002020  53 00 30 31 31 00 00 00  00 00 00 00 00 00 00 00  |S.011...........|
00002030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00003000  00 00 00 00 00 00 00 00  02 80 00 00 00 00 00 00  |................|
00003010  4c 45 53 00 48 43 53 41  00 61 72 5f 46 49 4c 45  |LES.HCSA.ar_FILE|
00003020  53 00 30 31 31 00 00 00  00 00 00 00 00 00 00 00  |S.011...........|
00003030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
But issue I am having is when I do fdisk , it says /dev/sdb2 is LVM

fdisk -l /dev/sdb
Code:
Disk /dev/sdb: 80.0 GB, 80000000000 bytes
240 heads, 63 sectors/track, 10333 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x48d97f5e

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1          14      105808+  83  Linux
/dev/sdb2              15        7752    58499280   8e  Linux LVM

Last edited by cbtshare; 12-30-2013 at 08:37 PM.
 
Old 12-30-2013, 09:17 PM   #11
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,116

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
The "Linux LVM" reported by fdisk is just from the type code 0x8e in the partition table. It says absolutely nothing about what data is actually present in the partition.

That hex dump is not what you should be seeing at the beginning of an LVM physical volume. Somehow you've managed to get a partition table that doesn't match the actual layout of the partitions on the disk.

What you need to do now is get a copy of testdisk and let it try to find the actual start of the LVM volume. Since there might be a disk geometry issue, you may need to go into the "Options" menu and disable the "Align partition" option. That does make testdisk slow since it will looking for partitions starting at every sector and not just the ones that are on cylinder or Megabyte boundaries, but should be tolerable on an 80GB drive. Actually, you can stop the search once it has examined ~100 cylinders since you know that second partition should start fairly near the beginning of the disk. See what testdisk can find, and we'll proceed from there.
 
Old 01-02-2014, 08:52 AM   #12
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42
ok thank you, so far I did a search and I have the following:
Code:
TestDisk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sdb - 80 GB / 74 GiB - CHS 9726 255 63

The harddisk (80 GB / 74 GiB) seems too small! (< 119 GB / 111 GiB)
Check the harddisk size: HD jumpers settings, BIOS detection...

The following partition can't be recovered:
     Partition               Start        End    Size in sectors
>  HPFS - NTFS           9724 254 63 14587 254 62   78124095
Code:
Disk 6.14, Data Recovery Utility, July 2013
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sdb - 80 GB / 74 GiB - CHS 9726 255 63
     Partition               Start        End    Size in sectors
>* Linux                    0   1  1    13 254 63     224847 [/boot]
   Linux                   20  68 49  6914 127 61  110755840
   HPFS - NTFS           4862   0  1  9724 254 63   78124095
   Linux                 7836   1  1  7836 254 63      16002
   Linux LVM             9142   1  1  9534 254 63    6313482
 P FAT12                 9725   0  1  9725 254 63      16065 [DOSBOOT]


Structure: Ok.  Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable  P=Primary  L=Logical  E=Extended  D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
     Enter: to continue
ext3 blocksize=1024 Sparse superblock, 115 MB / 109 MiB
So does this mean my data is gone? .And I'm also not sure what this means,The harddisk (80 GB / 74 GiB) seems too small! (< 119 GB / 111 GiB)

Last edited by cbtshare; 01-02-2014 at 09:38 AM.
 
Old 01-02-2014, 01:41 PM   #13
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,116

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
The "seems too small" message is just because testdisk found what looked like the beginning of a large NTFS filesystem very near the end of the disk, which was almost certainly the backup NTFS boot sector that is stored at the end of its partition. Going back to your original thread, I see that your image file was 60GB. Since you have restored that 60GB image to an 80GB disk, anything beyond 60GB (roughly cylinder 7296 for C:H:S=xx:255:63) is just leftover stuff in that last 20GB.

That leaves me very suspicious about the NTFS header that testdisk found at CHS 4862 0 1. That NTFS filesystem would have extended to the end of an 80GB disk, and so could not have been present on a 60GB disk, yet it starts within the 60GB that was apparently saved and restored.

What was the command you used to restore the image to the new HD? Did it report a full 60GB transferred?
 
Old 01-02-2014, 08:00 PM   #14
cbtshare
Member
 
Registered: Jul 2009
Posts: 619

Original Poster
Rep: Reputation: 42
Ahh ok, I get you.Well the command I used was

Quote:
dd if=/nfsDrive/backup.img of=/dev/sdb
that didnt work , so I also partitioned the drive then

Quote:
dd if=/nfsDrive/backup.img of=/dev/sdb1
I am not sure which version of the commands I did and is restored on the disk now.But whatever method you suggest I will use.

As far as the reporting,I dont recollect how much data it echoed was transferred.Any advice will be well received.
 
Old 01-02-2014, 08:37 PM   #15
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 3,116

Rep: Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339Reputation: 1339
Quote:
Originally Posted by cbtshare View Post
Ahh ok, I get you.Well the command I used was
Code:
dd if=/nfsDrive/backup.img of=/dev/sdb
that didnt work , so I also partitioned the drive then
Code:
dd if=/nfsDrive/backup.img of=/dev/sdb1
Please use [CODE]...[/CODE] tags and not QUOTE tags around code fragments and commands. QUOTE-ed material gets omitted when I try to quote you in a reply, and I have to paste it in manually.

Well, that's a mess. You took an image which, according to your previous thread, was
Quote:
Code:
file -s /Downloads/usb/backup_set_1.img
/Downloads/usb/backup_set_1.img: x86 boot sector; GRand Unified Bootloader, stage1 version 0x3, boot
  drive 0x80, 1st sector stage2 0xb441; partition 1: ID=0x83, active, starthead 1, startsector 63,
  211617 sectors; partition 2: ID=0x8e, starthead 0, startsector 211680, 116998560 sectors, code
  offset 0x48
which is an image of an entire disk, including the MBR with the primary partition table, and copied that into one partition of the new disk. Furthermore, it appears that /dev/sdb1 is only about 105MB
Quote:
Disk /dev/sdb: 80.0 GB, 80000000000 bytes
240 heads, 63 sectors/track, 10333 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x48d97f5e

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 14 105808+ 83 Linux
/dev/sdb2 15 7752 58499280 8e Linux LVM
which wouldn't come close to holding that whole image. That means that none of the output from testdisk is relevant.

That first command was the correct one. What was it that "didnt work"? Please run that command again and see what you get.
 
  


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
[SOLVED] How do I SSH into an Encrypted partition? I have backed up all of my files on it theif519 Linux - Newbie 3 07-05-2011 11:15 AM
fresh 9.10 install reboot error no device trying to mount partition mount: can't fin bud1237 Ubuntu 1 06-24-2010 01:44 AM
how mount mount ntfs partition of windows xp kashif2131971 Linux - Newbie 3 07-07-2009 07:34 PM
Fedora 11: Cannot mount partition on Seagate FreeAgent Drive's secondary partition Erik Anderson Linux - Newbie 5 06-25-2009 02:10 AM
This is how I backed up my root partition cragwolf Slackware 3 09-14-2004 07:39 PM


All times are GMT -5. The time now is 08:37 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