[clue-tech] How do I mount a partition on a RAID array?

Dan Poler dpoler at redhat.com
Thu Aug 30 11:53:28 MDT 2007


> The following will work:
> 
> #!/bin/bash
> #skip offset based on end block of previous partition
> losetup -o2048 /dev/loop1 /dev/md2			#skip 1st 2048 bytes
> losetup -o109056000 /dev/loop2 /dev/md2			#26625*4096
> losetup -o7622107136 /dev/loop3 /dev/md2		#1860866*4096
> #extended partition adds 2048 bytes for partition table
> losetup -o10843342848 /dev/loop6 /dev/md2		#2647300*4096 + 2048
> losetup -o11917088768 /dev/loop7 /dev/md2		#2909445*4096 + 2048
> losetup -o12990834688 /dev/loop0 /dev/md2		#3171590*4096 + 2048
> 
> mount -t ext3 /dev/loop2 /home/ockers/sandbox
> mount -t ext2 /dev/loop1 /home/ockers/sandbox/boot
> mount -t ext3 /dev/loop3 /home/ockers/sandbox/opt
> mount -t ext3 /dev/loop6 /home/ockers/sandbox/opt/data
> mount -t ext3 /dev/loop7 /home/ockers/sandbox/tmp
> mount -t ext3 /dev/loop0 /home/ockers/sandbox/home
> 
I suspect (but am not certain) that a well-crafted udev rule could have
created the correct devices. Would require some research, but when you
need magic to happen in /dev, udev can usually get you there. Generally
speaking, it should not be necessary to create devices directly in /dev
-- and be careful doing so; /dev is created dynamically on each boot and
devices you create by hand will NOT be recreated after a reboot.

(note I speak only of RHEL and CentOS here as that's my forte - YMMV on
other distros)

> There's no /dev/loop8 and so I had to deviate from the usual partition
> naming scheme and call it loop0.  I tried making a /dev/loop8 but the 
> loop driver didn't like it.

[root at xxxxxx ~]# modinfo loop
filename:       /lib/modules/2.6.18-8.1.1.el5/kernel/drivers/block/loop.ko
alias:          block-major-7-*
license:        GPL
srcversion:     A7A1ADE72D35A9D28D82826
depends:        
vermagic:       2.6.18-8.1.1.el5 SMP mod_unload 686 REGPARM 4KSTACKS gcc-4.1
parm:           max_loop:Maximum number of loop devices (1-256) (int)

so 'modprobe loop max_loop 16' or so would also get'cha there, so's
you'd have a /dev/loop8.

HTH

dap
-- 
Dan Poler, RHCE
Senior Consultant
Red Hat, Inc.
E-Mail: dpoler at redhat.com
Phone: +1 (303) 502-4576
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://cluedenver.org/pipermail/clue-tech/attachments/20070830/ff7c9bb1/attachment-0002.bin


More information about the clue-tech mailing list