* File as generic block-device?
@ 2008-10-22 12:56 Simen Thoresen
2008-10-22 13:30 ` Geert Uytterhoeven
2008-10-22 13:33 ` martin f krafft
0 siblings, 2 replies; 5+ messages in thread
From: Simen Thoresen @ 2008-10-22 12:56 UTC (permalink / raw)
To: linux-kernel
Hi all,
I have a project where I require to treat a file as a block-device
(specifically, I want a file on an ext3 fs to act as one of the
raid-members in a md-based stripe-set. I know that I can make a
/filesystem/ on a file because both mkfs and mount (with -o loop) will
accept a file as a block-device, but I have found no such function for
mdadm, and am thus asking for a kernel-internal way to re-plug a file
into the block-device layer.
Is this possible?
My current platform i CentOS5, a RHEL5 rebuild (modified 2.6.18-kernel).
-S
--
Simen Thoresen - Dolphin ICS Systems Administrator
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: File as generic block-device?
2008-10-22 12:56 File as generic block-device? Simen Thoresen
@ 2008-10-22 13:30 ` Geert Uytterhoeven
2008-10-22 13:36 ` Simen Thoresen
2008-10-22 13:33 ` martin f krafft
1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2008-10-22 13:30 UTC (permalink / raw)
To: Simen Thoresen; +Cc: linux-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1072 bytes --]
On Wed, 22 Oct 2008, Simen Thoresen wrote:
> I have a project where I require to treat a file as a block-device
> (specifically, I want a file on an ext3 fs to act as one of the raid-members
> in a md-based stripe-set. I know that I can make a /filesystem/ on a file
> because both mkfs and mount (with -o loop) will accept a file as a
> block-device, but I have found no such function for mdadm, and am thus asking
> for a kernel-internal way to re-plug a file into the block-device layer.
>
> Is this possible?
Sure! You just have to create the loop device (/dev/loop*) yourself using
losetup(8). `mount -o loop' does it itself behind your back.
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Techsoft Centre Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
A division of Sony Europe (Belgium) N.V.
VAT BE 0413.825.160 · RPR Brussels
Fortis · BIC GEBABEBB · IBAN BE41293037680010
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: File as generic block-device?
2008-10-22 12:56 File as generic block-device? Simen Thoresen
2008-10-22 13:30 ` Geert Uytterhoeven
@ 2008-10-22 13:33 ` martin f krafft
2008-10-22 13:51 ` Simen Thoresen
1 sibling, 1 reply; 5+ messages in thread
From: martin f krafft @ 2008-10-22 13:33 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: text/plain, Size: 605 bytes --]
also sprach Simen Thoresen <simentt@dolphinics.no> [2008.10.22.1456 +0200]:
> accept a file as a block-device, but I have found no such function
> for mdadm, and am thus asking for a kernel-internal way to
> re-plug a file into the block-device layer.
I suggest you search the web first.
http://en.wikipedia.org/wiki/Loopback_disk_device
--
martin | http://madduck.net/ | http://two.sentenc.es/
"you don't sew with a fork, so i see no reason
to eat with knitting needles."
-- miss piggy, on eating chinese food
spamtraps: madduck.bogus@madduck.net
[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 197 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: File as generic block-device?
2008-10-22 13:30 ` Geert Uytterhoeven
@ 2008-10-22 13:36 ` Simen Thoresen
0 siblings, 0 replies; 5+ messages in thread
From: Simen Thoresen @ 2008-10-22 13:36 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-kernel
Geert Uytterhoeven wrote:
> On Wed, 22 Oct 2008, Simen Thoresen wrote:
>> I have a project where I require to treat a file as a block-device
>> (specifically, I want a file on an ext3 fs to act as one of the raid-members
>> in a md-based stripe-set. I know that I can make a /filesystem/ on a file
>> because both mkfs and mount (with -o loop) will accept a file as a
>> block-device, but I have found no such function for mdadm, and am thus asking
>> for a kernel-internal way to re-plug a file into the block-device layer.
>>
>> Is this possible?
>
> Sure! You just have to create the loop device (/dev/loop*) yourself using
> losetup(8). `mount -o loop' does it itself behind your back.
Ah! Perfect, thank you.
-S
> With kind regards,
>
> Geert Uytterhoeven
> Software Architect
>
> Sony Techsoft Centre Europe
> The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
>
> Phone: +32 (0)2 700 8453
> Fax: +32 (0)2 700 8622
> E-mail: Geert.Uytterhoeven@sonycom.com
> Internet: http://www.sony-europe.com/
>
> A division of Sony Europe (Belgium) N.V.
> VAT BE 0413.825.160 · RPR Brussels
> Fortis · BIC GEBABEBB · IBAN BE41293037680010
--
Simen Thoresen - Dolphin ICS Systems Administrator
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: File as generic block-device?
2008-10-22 13:33 ` martin f krafft
@ 2008-10-22 13:51 ` Simen Thoresen
0 siblings, 0 replies; 5+ messages in thread
From: Simen Thoresen @ 2008-10-22 13:51 UTC (permalink / raw)
To: linux-kernel
martin f krafft wrote:
> also sprach Simen Thoresen <simentt@dolphinics.no> [2008.10.22.1456 +0200]:
>> accept a file as a block-device, but I have found no such function
>> for mdadm, and am thus asking for a kernel-internal way to
>> re-plug a file into the block-device layer.
>
> I suggest you search the web first.
> http://en.wikipedia.org/wiki/Loopback_disk_device
Thank you - I missed googling for the absolutely obvious.
Sigh.
-S
--
Simen Thoresen - Dolphin ICS Systems Administrator
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-10-22 13:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-22 12:56 File as generic block-device? Simen Thoresen
2008-10-22 13:30 ` Geert Uytterhoeven
2008-10-22 13:36 ` Simen Thoresen
2008-10-22 13:33 ` martin f krafft
2008-10-22 13:51 ` Simen Thoresen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox