LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 07:05 AM   #31
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,830

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308

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

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

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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 08:45 AM.
 
Old 09-08-2016, 06: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, 06: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, 06:31 PM   #36
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

Rep: Reputation: Disabled
You cannot perform any work on partial image, you need the image of full partition.
 
Old 09-09-2016, 06: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, 06:11 AM   #38
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
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, 06:16 AM   #39
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~amd64
Posts: 7,661

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

Rep: Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308Reputation: 7308
what will fdisk -l /dev/sda respond? (what was the original ?)
 
Old 09-09-2016, 07:19 AM   #41
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,776

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
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



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

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

All times are GMT -5. The time now is 07:48 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
Open Source Consulting | Domain Registration