sudo mdadm --build /dev/md0 --level=linear --raid-devices=3 /dev/loop0 /dev/sda1 /dev/sda2
After running the above command,
/dev/md0 is smaller than
/dev/sda2. Why is that happening, and how can I make it the correct size?
/dev/sda1 is a very small partition needed by the
/dev/sda2 Windows 7 partition in order for Windows to boot properly.
/dev/loop0 is a loop back device I created using this command:
sudo losetup /dev/loop0 boot.mbr. boot.mbr is an image file which is a copy of the first 2048 sectors that appear at the beginning of my
/dev/sda disk just before the start of the first partition,
/dev/sda1. Those sectors contain the Grub bootloader. This is the command I ran to create that image file:
dd if=/dev/zero of=boot.mbr count=2048. The reason it needs to be the same size, is I am trying to setup the
/dev/md0 virtual hard disk to mimick the layout of the Grub bootloader and those 2 partitions, but I run out of bytes when trying to setup the last partition because there are not enough bytes on the
/dev/md0 disk. If you need more context, here is a link to my other question that explains why I am doing this: https://superuser.com/questions/931645/with-linux-mint-as-main-os-dual-boot-windows-7-and-have-a-windows-7-virtual-mac/937491#937491
- Linux Mint 17.2 64 bit with Cinnamon
- mdadm - v3.2.5
- dd (coreutils) 8.21
/dev/sda1 as being 1572864000 bytes. It shows
/dev/sda2 as being 229318000128 bytes. My file system shows boot.mbr as being 1048576. So if you add those three numbers together, the
/dev/md0 drive should be at least 230891912704 bytes. But fdisk shows /dev/md0 as being 230891847680 bytes. So
/dev/md0 is somehow 65024 bytes smaller than it needs to be.
I thought perhaps the problem was with the loop back device
fdisk -l /dev/loop0 shows the device as having 1048576 bytes, so it does match the size of the image file. However, fdisk complains about
/dev/loop0 not having any cylindars. Could that be the problem somehow? I am just grasping at straws here.
/dev/md0 is a virtual hard disk created by software RAID, what does that really mean? For one thing where is its data stored? Perhaps I am running out of memory or storage space somewhere?