Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
loop mounting a single partition on imaged drive [SOLVED]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 730

PostPosted: Tue Nov 25, 2014 4:35 pm    Post subject: loop mounting a single partition on imaged drive [SOLVED] Reply with quote

Hi, I followed the instructions here for creating an image of an NTFS partitioned hard-drive. Namely:
Code:
# dd if=/dev/hda conv=sync,noerror bs=64K | gzip -c  > ./backup.img.gz


I kept the bs=64K because they seemed to recommend it.

I also saved the "extra info" as they recommended it:
Code:
# fdisk -l /dev/sdi > backup_fdisk.info

Disk /dev/sdi: 298.1 GiB, 320072933376 bytes, 625142448 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
Disklabel type: dos
Disk identifier: 0x5a660aa0

Device    Boot     Start       End    Blocks  Id System
/dev/sdi1           2048  29362175  14680064  27 Hidden NTFS WinRE
/dev/sdi2 *     29362176  29566975    102400   7 HPFS/NTFS/exFAT
/dev/sdi3       29566976 625139711 297786368   7 HPFS/NTFS/exFAT


Now I want to mount the third partition starting on block 29566976 but when I follow the instructions according to here I get the following error message:
Code:
# losetup /dev/loop0 backup.img.gz -o $((29566976 * 512))

losetup: backup.img.gz: Warning: file does not fit into a 512-byte sector; the end of the file will be ignored.


I'm not sure what to do about this. Is it because the image is compressed?

If I run fdisk -lu on the image file itself I get:
Code:
fdisk -lu backup.img.gz

Disk backup.img.gz: 232.2 GiB, 249369201152 bytes, 487049221 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


I'm not sure if that is useful. Any help would be appreciated. Thanks.

dq


Last edited by don quixada on Thu Nov 27, 2014 5:38 am; edited 1 time in total
Back to top
View user's profile Send private message
SDNick484
Apprentice
Apprentice


Joined: 05 Dec 2005
Posts: 212

PostPosted: Tue Nov 25, 2014 11:43 pm    Post subject: Reply with quote

I've never tried this method before, but it looks interesting. If I had to guess your issue, the problem may be related to the fact that your backup is compressed (gzip -c) and the offset your pointing (-o 29566976) is not. If you have the space, perhaps try to decompress the image via gunzip and use the same losetup command on the decompressed file (i.e. backup.gz).
Back to top
View user's profile Send private message
don quixada
l33t
l33t


Joined: 15 May 2003
Posts: 730

PostPosted: Thu Nov 27, 2014 5:37 am    Post subject: Reply with quote

Yes, that was it. It took forever to gunzip it but once I did I was able to mount no problem! Incidentally, I also tried 'partimage' on one partition of the hard drive but I haven't figured-out how to mount it either...

dq
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum