----- Original Message -----
From: "Mark" <ma...@ti...>
Newsgroups: alt.comp.linux
Sent: Friday, February 03, 2006 4:37 PM
Subject: Re: can I simulate a physical raid using image files (loop device)?
> On Thu, 02 Feb 2006 14:02:00 -0500, J wrote:
>
>> if you can mount a disk image (dd, iso) using a loopx device file, can
>> you
>> access several of them with linux software raid tools?
>
> Why not just try?
>
> I got curious too and gave it a shot, and seems to work...
>
> #dd if=/dev/zero of=disk1 bs=1k count=102400
> #dd if=/dev/zero of=disk2 bs=1k count=102400
> #losetup /dev/loop0 disk1
> #losetup /dev/loop1 disk2
> #mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/loop0 /dev/loop1
> #mkfs.ext3 /dev/md0
> #mount /dev/md0 /mnt
> # df -h /mnt
> Filesystem Size Used Avail Use% Mounted on
> /dev/md0 97M 4.1M 88M 5% /mnt
> 0# cat /proc/mdstat
> Personalities : [raid1]
> md0 : active raid1 loop1[1] loop0[0]
> 102336 blocks [2/2] [UU]
>
> Rgds,
> Mark.
>
>> I'd like to simulate raid by creating 3 or 4 100MB files, mounting them
>> as a
>> raid volume and formatting them.
>>
>> Curious,
>>
>> Jessop
>
|