Skip to content

Instantly share code, notes, and snippets.

@ricardoanguiano
Last active December 15, 2015 15:58
Show Gist options
  • Save ricardoanguiano/bda8da6d42befea1cb29 to your computer and use it in GitHub Desktop.
Save ricardoanguiano/bda8da6d42befea1cb29 to your computer and use it in GitHub Desktop.
Linux RAID0
root@trusty01:~# fdisk -l /dev/sdb
Disk /dev/sdb: 256.1 GB, 256060514304 bytes
234 heads, 63 sectors/track, 33924 cylinders, total 500118192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xba903263
Device Boot Start End Blocks Id System
/dev/sdb1 2048 500118191 250058072 fd Linux raid autodetect
root@trusty01:~# fdisk -l /dev/sdc
Disk /dev/sdc: 256.1 GB, 256060514304 bytes
168 heads, 63 sectors/track, 47252 cylinders, total 500118192 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x6f331eaa
Device Boot Start End Blocks Id System
/dev/sdc1 2048 500118191 250058072 fd Linux raid autodetect
root@trusty01:~# mdadm --create --verbose /dev/md0 --level=stripe --raid-devices=2 /dev/sdb1 /dev/sdc1
mdadm: chunk size defaults to 512K
mdadm: /dev/sdb1 appears to contain an ext2fs file system
size=245366784K mtime=Mon Nov 30 21:28:24 2015
mdadm: /dev/sdc1 appears to contain an ext2fs file system
size=250058072K mtime=Mon Nov 30 21:27:04 2015
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.
root@trusty01:~# mkfs -t ext4 /dev/md0
mke2fs 1.42.9 (4-Feb-2014)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=128 blocks, Stripe width=256 blocks
31260672 inodes, 125028864 blocks
6251443 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
3816 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,
102400000
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
root@trusty01:~# tune2fs -l /dev/md0
tune2fs 1.42.9 (4-Feb-2014)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: 58768622-3399-4da0-a79c-e9742096453e
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype needs_recovery extent flex_bg sparse_super large_file huge_file uninit_bg dir_nlink extra_isize
Filesystem flags: signed_directory_hash
Default mount options: user_xattr acl
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 31260672
Block count: 125028864
Reserved block count: 6251443
Free blocks: 123016216
Free inodes: 31260661
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 994
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 512
RAID stride: 128
RAID stripe width: 256
Flex block group size: 16
Filesystem created: Mon Nov 30 21:44:38 2015
Last mount time: Mon Nov 30 21:45:03 2015
Last write time: Mon Nov 30 21:45:03 2015
Mount count: 1
Maximum mount count: -1
Last checked: Mon Nov 30 21:44:38 2015
Check interval: 0 (<none>)
Lifetime writes: 133 MB
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 256
Required extra isize: 28
Desired extra isize: 28
Journal inode: 8
Default directory hash: half_md4
Directory Hash Seed: 08de8825-c550-463e-a206-42ecf45b0fd7
Journal backup: inode blocks
root@trusty01:/scratch/ricardo# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdc1 during installation
UUID=2cf4b98a-66e5-47dd-a6ed-5745a2e9fe12 / ext4 errors=remount-ro 0 1
# swap was on /dev/sdc2 during installation
UUID=9e3f7a98-59d5-4036-8151-88c4d7b34f75 none swap sw 0 0
# md0
UUID=58768622-3399-4da0-a79c-e9742096453e /scratch ext4 defaults,errors=remount-ro,nobootwait,noatime 0 0
# save the array setup to /etc/mdadm/mdadm.conf
root@trusty01:~# /usr/share/mdadm/mkconf > /etc/mdadm/mdadm.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment