RAID OVER LOOP DEVICES (RAID 5)
In this tutorial we will learn how one can configure RAID over loop devices. For demonstration i have created RAID-5 here over loop devices.
First we Need to Create three files.
Here I have created three files of equal size. each 1GB
-
create 3 files = a.txt ,b.txt and c.txt
-
dd if=/dev/zero of=a.txt bs=1M count=1000
-
dd if=/dev/zero of=b.txt bs=1M count=1000
-
dd if=/dev/zero of=c.txt bs=1M count=1000 (2nd formula copy a.txt #cp a.txt b.txt c.txt) copy same size file
-
ls -lh show the fileattach file with the loop devices because loop devices has no size.
-
losetup /dev/loop1 a.txt
-
losetup /dev/loop2 b.txt
-
losetup /dev/loop3 c.txtcreate raid 5 using loop devices
-
mdadm –create /dev/md0 –level=5 –raid-devices=3 /dev/loop1 /dev/loop2 /dev/loop3
-
mdadm –detail /dev/md0 ( to check raid devices detail)
-
cat /proc /mdstat (check sysconize)
-
format= mkfs.ext3 /dev/md0
-
mkdir /B
-
mount /dev/md0 /B
-
umount /B
-
mdadm –stop /dev/md0
-
mdadm –remove /dev/md0
-
losetup -d /dev/loop1
-
losetup -d /dev/loop2
-
losetup -d /dev/loop3
-
delete file = # rm -rf *.txt
Discover more from Learn Linux CCNA CCNP CEH CISSP CISA Penetration-Testing Bug Bounty IPv6 Cyber-Security Network-Security Online
Subscribe to get the latest posts sent to your email.
