LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 09-08-2016, 08:05 AM   #31
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,500

Rep: Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314

based on that ddrescue was not successful, the image file is incomplete.
 
Old 09-08-2016, 08:19 AM   #32
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,316

Rep: Reputation: Disabled
This is very likely, yes. Reported image size 4 GB is rather small for home partition.
 
Old 09-08-2016, 09:43 AM   #33
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,336

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
Quote:
Originally Posted by lilzz View Post
if I do e2fsck -f my_file2.img
e2fsck 1.42.9 (4-Feb-2014)
ext2fs_open2: Bad magic number in super-block
e2fsck: Superblock invalid, trying backup blocks...
Error reading block 6324224 (Attempt to read block from filesystem resulted in short read).
e2fsck is trying to read what would be the last block in a ~25.9GB (24.12 GiB) filesystem. That image file is too small to hold a filesystem of that size.

Last edited by rknichols; 09-08-2016 at 09:45 AM.
 
Old 09-08-2016, 07:25 PM   #34
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by pan64 View Post
would be nice to know how did you create that image exactly.
from the bad hard drive
sudo ./ddrescue -n /dev/sda5 /media/HP/my_file2.img

that's how I created it.
 
Old 09-08-2016, 07:26 PM   #35
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Emerson View Post
This is very likely, yes. Reported image size 4 GB is rather small for home partition.
yeah, because my usb stick is not big enough.
Can that 4GB image file be mounted?
 
Old 09-08-2016, 07:31 PM   #36
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,316

Rep: Reputation: Disabled
You cannot perform any work on partial image, you need the image of full partition.
 
Old 09-09-2016, 07:02 AM   #37
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Emerson View Post
You cannot perform any work on partial image, you need the image of full partition.
OK, I use ddrescue and saved to a backup USB drive which is big enough.
Now, I use a healthy system and fdisk my_file2.img

fdisk -l my_file2.img

Disk my_file2.img: 58.7 GB, 58730741760 bytes
255 heads, 63 sectors/track, 7140 cylinders, total 114708480 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: 0x00000000

Disk my_file2.img doesn't contain a valid partition table
==========================

now , how do I mount the rescued image? It prompts for file type.
I did use -t auto but it didn't help.

I did file my_file2.img
my_file2.img: data
 
Old 09-09-2016, 07:11 AM   #38
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,844

Rep: Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478Reputation: 1478
How big was the original disk? 58.7 GB is not a size of any disk drive manufactured in the last 10 years. The size provided would be between 60 and 100GB and seems small.
 
Old 09-09-2016, 07:16 AM   #39
Emerson
LQ Guru
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 6,316

Rep: Reputation: Disabled
I think this is an image of home partition.
 
Old 09-09-2016, 07:33 AM   #40
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,500

Rep: Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314Reputation: 4314
what will fdisk -l /dev/sda respond? (what was the original ?)
 
Old 09-09-2016, 08:19 AM   #41
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: CentOS
Posts: 4,336

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
You copied just one partition. There is no partition table. That is normal.

Now you need to run fsck on the image file:
Code:
e2fsck my_file2.img
If it looks like it is behaving reasonably and you're geting tired of typing "y" to all the prompts, interrupt it with ctrl-c, then run it again with the "-y" option.
Code:
e2fsck -y my_file2.img
Once e2fsck has recovered the primary super block and patched up the rest of the filesystem, you should be able to mount the image with the "-o loop" option.
 
1 members found this post helpful.
  


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 to mount .img file linuxboy2008 Linux - General 15 10-30-2018 12:17 AM
[SOLVED] How to mount DOS img file? kaza Linux - Software 14 01-23-2017 07:14 PM
Mount a .img file chaz_d Linux - General 3 09-26-2012 08:46 PM
[SOLVED] Mounting .img file (chromiumos.img); can't mount it?? Help please? linus72 Linux - General 2 11-27-2009 09:11 PM
Mount *.img file - What fs type tobiasw Linux - General 14 10-17-2006 04:43 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 01:23 AM.

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