LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 08-27-2016, 06:37 AM   #16
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920Reputation: 2920

https://chrisdown.name/2011/06/01/fs...-an-image.html
 
Old 08-27-2016, 08:34 AM   #17
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
Alternatively, you could pass the file to a VM as an emulated disk...
 
Old 09-06-2016, 07:09 PM   #18
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
I try ddrescue on a bad harder I've booted with liveCD, trying ubuntu
1)sudo./ddrescue -n /dev/sda5 /home/ubuntu/my_file.img but it complains running out of space on that drive? Why? The hard drive is big. I check /home which is only 2 GB. What?

2) I try write to my USB stick
sudo ./ddrescue -n /dev/dev5 /sdc/sdc1/my_file.img but it says
ddrescue cannot open output file. No such file or directory.
 
Old 09-06-2016, 09:20 PM   #19
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
/sdc/sdc1/my_file.img is very likely not valid unless you have a directory /sdc with a directory /sdc1 in it (or a mounted device with the same directory tree.
 
Old 09-06-2016, 09:23 PM   #20
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 7,231

Rep: Reputation: Disabled
/home/ubuntu is probably in RAM.
 
Old 09-07-2016, 12:26 AM   #21
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jpollard View Post
/sdc/sdc1/my_file.img is very likely not valid unless you have a directory /sdc with a directory /sdc1 in it (or a mounted device with the same directory tree.
I use lsblk and it shows /dev/sdc1 as my USB. So what you suggest so I can write that to my usb
 
Old 09-07-2016, 04:48 AM   #22
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 7,231

Rep: Reputation: Disabled
Yes you can write to sdc1, but if you want to write into a file on sdc1 then you need to mount it first.
 
Old 09-07-2016, 06:45 AM   #23
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Emerson View Post
Yes you can write to sdc1, but if you want to write into a file on sdc1 then you need to mount it first.
mount? I thought usb stick is auto-mount. It's already auto mounted at /media/..
 
Old 09-07-2016, 07:06 AM   #24
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,981

Rep: Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734
in that case you can write that filesystem, but that .img file is still not mounted. It is just a regular file on the usb.
 
Old 09-07-2016, 07:08 AM   #25
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 7,231

Rep: Reputation: Disabled
Quote:
Originally Posted by lilzz View Post
mount? I thought usb stick is auto-mount. It's already auto mounted at /media/..
If it is mounted in media why are you trying to write it to sdc1/image ? This is not where it is mounted.
 
Old 09-08-2016, 06:09 AM   #26
lilzz
Member
 
Registered: Aug 2006
Posts: 73

Original Poster
Rep: Reputation: 15
Ok, I use ddrescue and created the my_file2.img 4GB

file my_file2.img
my_file2.img: data

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). Ignore error<y>? yes
..



when I try mount it , it wants file type.

anyway, so looks like the same effect using dd or ddrescue.
 
Old 09-08-2016, 06:13 AM   #27
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 7,231

Rep: Reputation: Disabled
No valid superblocks found?
 
Old 09-08-2016, 06:39 AM   #28
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512Reputation: 1512
If it is a disk image it likely contains a partition table at the beginning - not a filesystem.

Even a damaged partition table. The filesystems start at some offset from the beginning, but without a valid partition table identifying those offsets will be tricky.

http://www.andremiller.net/content/m...ns-using-linux

Last edited by jpollard; 09-08-2016 at 06:43 AM.
 
Old 09-08-2016, 06:59 AM   #29
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,981

Rep: Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734Reputation: 5734
would be nice to know how did you create that image exactly.
 
Old 09-08-2016, 07:03 AM   #30
Emerson
LQ Sage
 
Registered: Nov 2004
Location: Saint Amant, Acadiana
Distribution: Gentoo ~arch
Posts: 7,231

Rep: Reputation: Disabled
Quote:
Originally Posted by lilzz View Post
I try ddrescue on a bad harder I've booted with liveCD, trying ubuntu
1)sudo./ddrescue -n /dev/sda5 /home/ubuntu/my_file.img but it complains running out of space on that drive? Why? The hard drive is big. I check /home which is only 2 GB. What?

2) I try write to my USB stick
sudo ./ddrescue -n /dev/dev5 /sdc/sdc1/my_file.img but it says
ddrescue cannot open output file. No such file or directory.
I see an attempt to image sda5.
 
  


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-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 12:35 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
Open Source Consulting | Domain Registration