Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


Closed Thread
  Search this Thread
Old 05-03-2007, 09:49 AM   #1
LQ Newbie
Registered: May 2007
Posts: 2

Rep: Reputation: 0
mdadm, images over loopback, raid5, can't create partitions

Hi all,

I want to create a test environment for learning purposes. This is not a production setup of any kind:

Since I don't have 4 disks to use those to build my raid I want to use 4 files as a block device:

I created 4 files using:

dd if=/dev/zero of=disk0.dd bs=512k count=20
dd if=/dev/zero of=disk1.dd bs=512k count=20
dd if=/dev/zero of=disk2.dd bs=512k count=20
dd if=/dev/zero of=disk3.dd bs=512k count=20
I mounted these files as block devices doing:

losetup /dev/loop0 disk0.dd
losetup /dev/loop0 disk1.dd
losetup /dev/loop0 disk2.dd
losetup /dev/loop0 disk3.dd
I created a raid out of these disks using mdadm (The raid is online and looks healthy):

mdadm --create /dev/md0 --level=5 --raid-devices=4 --auto=part /dev/loop[0123]
I want to create 1 simple primary partition on /dev/md0 so I can format it using ext3.
When doing this with fdisk /dev/md0 I can create the partition but when I write it I get:

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 22: Invalid argument.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.
I can't create that partition, or at lease, I can't activate that partition,.... there is no /dev/md0p1 anywhere.

stopping the raid and reassembling it doesn't work either,....

It could be a problem related to the fact that i'm using the loopback driver,....

So, how can I get a healthy working partition with this setup?

Any opinions about this?
Old 05-03-2007, 03:46 PM   #2
LQ Guru
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

Closed Thread

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
Can't create partition on mdadm raid5 and images mounted over loopback emat Linux - Software 2 06-11-2011 01:23 PM
raid5 with mdadm does not ron or rebuild adiehl Linux - General 12 07-26-2010 10:01 AM
mdadm and raid5 doorito Linux - Server 16 10-13-2009 08:56 PM
raid5 through mdadm doorito Linux - Server 1 04-09-2007 09:22 PM
Growing RAID5 with mdadm not working in 2.6.17? Fredde87 Linux - Software 1 08-24-2006 03:45 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:00 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration