Skip to content

Instantly share code, notes, and snippets.

MotomaSTYLE raiddemo # fdisk smbmountpoint/image
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that, of course, the previous
content won't be recoverable.
You must set cylinders.
You can do this from the extra functions menu.
Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)
MotomaSTYLE raiddemo # mknod -m660 loopnfs b 7 100
MotomaSTYLE raiddemo # mknod -m660 loopsmb b 7 10
MotomaSTYLE raiddemo # fdisk -ul nfsmountpoint/image
You must set cylinders.
You can do this from the extra functions menu.
Disk nfsmountpoint/image: 0 MB, 0 bytes
255 heads, 63 sectors/track, 0 cylinders, total 0 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
nfsmountpoint/image1 63 16450559 8225248+ fd Linux raid autodetect
MotomaSTYLE raiddemo # losetup -o 32256 loopnfs nfsmountpoint/image
MotomaSTYLE raiddemo # losetup -o 32256 loopsmb smbmountpoint/image
MotomaSTYLE raiddemo # mknod raiddev b 9 100
MotomaSTYLE raiddemo # mdadm -C -v raiddev -l5 -n2 loopnfs loopsmb
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 64K
mdadm: size set to 1048448K
mdadm: array raiddev started.
MotomaSTYLE raiddemo # mke2fs raiddev
mke2fs 1.38 (30-Jun-2005)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
131072 inodes, 262112 blocks
13105 blocks (5.00%) reserved for the super user
First data block=0
MotomaSTYLE raiddemo # mkdir raidmount
MotomaSTYLE raiddemo # mount raiddev raidmount/
MotomaSTYLE raiddemo # ls -la raidmount
total 20
drwxr-xr-x 3 root root 4096 Dec 27 22:25 ./
drwxr-xr-x 5 root root 160 Dec 27 22:27 ../
drwx------ 2 root root 16384 Dec 27 22:25 lost+found/
#! /usr/bin/env python
from os import fork, chdir, setsid, umask
from sys import exit
def main():
while 1:
#main daemon process loop
# Dual fork hack to make process run as a daemon
<?php
error_reporting(E_ALL);
ini_set('display_errors', True);