public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* useless image of hdd: how to make it useful?
@ 2002-11-18 10:08 Filipau, Ihar
  2002-11-18 20:51 ` Bill Davidsen
  2002-11-18 21:51 ` Andries Brouwer
  0 siblings, 2 replies; 4+ messages in thread
From: Filipau, Ihar @ 2002-11-18 10:08 UTC (permalink / raw)
  To: 'linux-kernel@vger.kernel.org'

Hello All!

	[ please CC me - I'm not subscribed to the list. ]

	This question was in my mind for couple of years.
	But after all I decided to ask it. (Better later - than never ;-))

	Little prehistory: I had on my old home PC two hard drives - hda &
hdc.
		hda was big and new, while hdc was old, small and sure it
contained 
		a lot of old useful stuff. So I decided to upgrade my very
valuable hdc.
		And sure, as simple novice in hdd upgrades, I've made smth
like:
			# dd if=/dev/hdc of=/root/hdc_img
		And right after upgrade - I got small rebate in exchange for
my old hdd - 
		I understood my problem.

	I do not know the way to mount partition table!
	it's possible with loop device to mount partition - but how to mount
whole 
	hdd (with its own partition table) to have access to single
partition inside???

	Digging into the kernel (it was 2.2 times) brought no answer:
major+minor was 
	used to identify the partition and I saw no way I can give this
beast 
	a file - not real hard drive.

	So that's the question:

	Is it possible to mount a 'hard drive' - just like any other fs -
and see 
	inside of this fs partitions as regular files?

PS As for my hdc - very quickly I came back to the shop and reversed my
/upgrade/... ;-)))

--- Regards&Wishes! With respect  Ihar "Philips" Filipau AKA Igor Philippov,
and Phil for friends

- - - - - - - - - - - - - - - - - - - - - - - - -
MCS/Mathematician - System Programmer
Ihar Filipau 
Software entwickler @ SUSS MicroTec Test Systems GmbH, 
Süss-Strasse 1, D-01561 Sacka (bei Dresden)
e-mail: ifilipau@sussdd.de  tel: +49-(0)-352-4073-327
fax: +49-(0)-352-4073-700   web: http://www.suss.com/

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: useless image of hdd: how to make it useful?
  2002-11-18 10:08 useless image of hdd: how to make it useful? Filipau, Ihar
@ 2002-11-18 20:51 ` Bill Davidsen
  2002-11-18 21:51 ` Andries Brouwer
  1 sibling, 0 replies; 4+ messages in thread
From: Bill Davidsen @ 2002-11-18 20:51 UTC (permalink / raw)
  To: Filipau, Ihar; +Cc: 'linux-kernel@vger.kernel.org'

On Mon, 18 Nov 2002, Filipau, Ihar wrote:

> Hello All!
> 
> 	[ please CC me - I'm not subscribed to the list. ]
> 
> 	This question was in my mind for couple of years.
> 	But after all I decided to ask it. (Better later - than never ;-))
> 
> 	Little prehistory: I had on my old home PC two hard drives - hda &
> hdc.
> 		hda was big and new, while hdc was old, small and sure it
> contained 
> 		a lot of old useful stuff. So I decided to upgrade my very
> valuable hdc.
> 		And sure, as simple novice in hdd upgrades, I've made smth
> like:
> 			# dd if=/dev/hdc of=/root/hdc_img
> 		And right after upgrade - I got small rebate in exchange for
> my old hdd - 
> 		I understood my problem.
> 
> 	I do not know the way to mount partition table!
> 	it's possible with loop device to mount partition - but how to mount
> whole 
> 	hdd (with its own partition table) to have access to single
> partition inside???

I believe that you can do it with a network block device, at least in
theory. I lack the inclination to try it, but I'd love to hear that this
suggestion was useful.

You can probably do it with loopback mount and offset, but if I had the
problem I'd try NBD just to see if you really can do it!

-- 
bill davidsen <davidsen@tmr.com>
  CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: useless image of hdd: how to make it useful?
  2002-11-18 10:08 useless image of hdd: how to make it useful? Filipau, Ihar
  2002-11-18 20:51 ` Bill Davidsen
@ 2002-11-18 21:51 ` Andries Brouwer
  2002-11-21 20:40   ` Bill Davidsen
  1 sibling, 1 reply; 4+ messages in thread
From: Andries Brouwer @ 2002-11-18 21:51 UTC (permalink / raw)
  To: Filipau, Ihar; +Cc: 'linux-kernel@vger.kernel.org'

On Mon, Nov 18, 2002 at 11:08:10AM +0100, Filipau, Ihar wrote:

> 			# dd if=/dev/hdc of=/root/hdc_img
> 
> 	I do not know the way to mount partition table!
> 	it's possible with loop device to mount partition - but how
>       to mount whole hddd (with its own partition table) to have
>       access to single partition inside???

loop knows about an offset:

First find where your partitions are:

% sfdisk -l -uS hdc_img
Warning: hdc_img is not a block device
Disk hdc_img: cannot get size
Disk hdc_img: cannot get geometry

Disk hdc_img: 0 cylinders, 0 heads, 0 sectors/track

Units = sectors of 512 bytes, counting from 0

   Device Boot    Start       End   #sectors  Id  System
 hdc_img1            63    112454     112392  83  Linux
 hdc_img2        112455    401624     289170  82  Linux swap
 hdc_img3        401625  33736499   33334875   5  Extended
 ...

OK, let us mount this first one, at an offset of 63 sectors.

% bc
63*512
32256

# mount hdc_img /mnt -o loop,offset=32256
#




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: useless image of hdd: how to make it useful?
  2002-11-18 21:51 ` Andries Brouwer
@ 2002-11-21 20:40   ` Bill Davidsen
  0 siblings, 0 replies; 4+ messages in thread
From: Bill Davidsen @ 2002-11-21 20:40 UTC (permalink / raw)
  To: Andries Brouwer; +Cc: Filipau, Ihar, 'linux-kernel@vger.kernel.org'

On Mon, 18 Nov 2002, Andries Brouwer wrote:

>    Device Boot    Start       End   #sectors  Id  System
>  hdc_img1            63    112454     112392  83  Linux
>  hdc_img2        112455    401624     289170  82  Linux swap
>  hdc_img3        401625  33736499   33334875   5  Extended
>  ...
> 
> OK, let us mount this first one, at an offset of 63 sectors.
> 
> % bc
> 63*512
> 32256
> 
> # mount hdc_img /mnt -o loop,offset=32256
> #

Being at heart a lazy fellow, and not counting on people to have bc
installed although they should...
  # mount hdc_img /mnt -o loop,offset=$[63*512]

-- 
bill davidsen <davidsen@tmr.com>
  CTO, TMR Associates, Inc
Doing interesting things with little computers since 1979.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-11-21 20:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-18 10:08 useless image of hdd: how to make it useful? Filipau, Ihar
2002-11-18 20:51 ` Bill Davidsen
2002-11-18 21:51 ` Andries Brouwer
2002-11-21 20:40   ` Bill Davidsen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox