Tag Archives: linux

a RAID6 made of pendrives


#mdadm --verbose --create /dev/md0 --level=6 --raid-devices=5 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 /dev/sdg1
mdadm: layout defaults to left-symmetric
mdadm: chunk size defaults to 512K
mdadm: layout defaults to left-symmetric
mdadm: layout defaults to left-symmetric
mdadm: /dev/sdc1 appears to contain an ext2fs file system
size=2000896K mtime=Thu Jan 1 01:00:00 1970
mdadm: layout defaults to left-symmetric
mdadm: /dev/sdd1 appears to contain an ext2fs file system
size=1970176K mtime=Thu Jan 1 01:00:00 1970
mdadm: layout defaults to left-symmetric
mdadm: /dev/sde1 appears to contain an ext2fs file system
size=1972224K mtime=Fri Apr 29 13:38:05 2011
mdadm: layout defaults to left-symmetric
mdadm: /dev/sdf1 appears to contain an ext2fs file system
size=2000896K mtime=Thu Jan 1 01:00:00 1970
mdadm: layout defaults to left-symmetric
mdadm: /dev/sdg1 appears to contain an ext2fs file system
size=1970176K mtime=Thu Jan 1 01:00:00 1970
mdadm: size set to 1968640K
mdadm: largest drive (/dev/sdc1) exceeds size (1968640K) by more than 1%
Continue creating array? y
mdadm: Defaulting to version 1.2 metadata
mdadm: array /dev/md0 started.

# mdadm --detail /dev/md0
/dev/md0:
Version : 1.2
Creation Time : Fri Apr 29 13:50:32 2011
Raid Level : raid6
Array Size : 5905920 (5.63 GiB 6.05 GB)
Used Dev Size : 1968640 (1922.82 MiB 2015.89 MB)
Raid Devices : 5
Total Devices : 5
Persistence : Superblock is persistent

Update Time : Fri Apr 29 13:51:27 2011
State : clean, resyncing
Active Devices : 5
Working Devices : 5
Failed Devices : 0
Spare Devices : 0

Layout : left-symmetric
Chunk Size : 512K

Rebuild Status : 8% complete

Name : fvaras-fixe:0 (local to host fvaras-fixe)
UUID : f2d6513e:84c70f15:be858661:686bbaa9
Events : 1

Number Major Minor RaidDevice State
0 8 33 0 active sync /dev/sdc1
1 8 49 1 active sync /dev/sdd1
2 8 65 2 active sync /dev/sde1
3 8 81 3 active sync /dev/sdf1
4 8 97 4 active sync /dev/sdg1

then, take a look to this post

By the way, I’m not even trying to fine tune this redundant array on inexpenside disks 😉

playing with LVMs and pendrives

# pvcreate /dev/sdc1
Physical volume "/dev/sdc1" successfully created
# pvcreate /dev/sdd1
Physical volume "/dev/sdd1" successfully created
# pvscan
PV /dev/sdc1 lvm2 [1.88 GiB]
PV /dev/sdd1 lvm2 [1.91 GiB]
Total: 2 [3.79 GiB] / in use: 0 [0 ] / in no VG: 2 [3.79 GiB]
fvaras-fixe:~# pvdisplay
"/dev/sdc1" is a new physical volume of "1.88 GiB"
--- NEW Physical volume ---
PV Name /dev/sdc1
VG Name
PV Size 1.88 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID QNgS1A-kWIh-rkur-ASdE-eMfi-PM60-loxxFG

"/dev/sdd1" is a new physical volume of "1.91 GiB"
--- NEW Physical volume ---
PV Name /dev/sdd1
VG Name
PV Size 1.91 GiB
Allocatable NO
PE Size 0
Total PE 0
Free PE 0
Allocated PE 0
PV UUID 6AfqES-nb59-98mK-B1Xe-a0zp-VNMv-lUY3DF

# vgcreate usb_lvm /dev/sdc1 /dev/sdd1
Volume group "usb_lvm" successfully created

# vgdisplay
--- Volume group ---
VG Name usb_lvm
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 1
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 3.79 GiB
PE Size 4.00 MiB
Total PE 969
Alloc PE / Size 0 / 0
Free PE / Size 969 / 3.79 GiB
VG UUID 25mnaz-FOXk-8x2a-3znt-L4Yr-3DNn-jiL7xb

# lvcreate -l 20 -n usb_vol1 usb_lvm
Logical volume "usb_vol1" created
# lvdisplay
--- Logical volume ---
LV Name /dev/usb_lvm/usb_vol1
VG Name usb_lvm
LV UUID VE3ZEh-TzyT-HDJe-z1ia-tnGE-Ct8m-flSlg5
LV Write Access read/write
LV Status available
# open 0
LV Size 80.00 MiB
Current LE 20
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 254:0

# mkfs.ext4 -L "usb_lvm" /dev/usb_lvm/usb_vol1
# mount /dev/usb_lvm/usb_vol1 /mnt/usbraid/
# cd /mnt/usbraid/
# mount
/dev/mapper/usb_lvm-usb_vol1
78M 5.6M 68M 8% /mnt/usbraid

# lvextend -L3000 /dev/usb_lvm/usb_vol1
Extending logical volume usb_vol1 to 2.93 GiB
Logical volume usb_vol1 successfully resized
-------------------

extending
# pvscan
PV /dev/sdc1 VG usb_lvm lvm2 [1.88 GiB / 0 free]
PV /dev/sdd1 VG usb_lvm lvm2 [1.91 GiB / 876.00 MiB free]
Total: 2 [3.79 GiB] / in use: 2 [3.79 GiB] / in no VG: 0 [0 ]
# pvcreate /dev/sde1
Physical volume "/dev/sde1" successfully created
# pvcreate /dev/sdf1
Physical volume "/dev/sdf1" successfully created
# vgextend usb_lvm /dev/sde1
Volume group "usb_lvm" successfully extended
# vgextend usb_lvm /dev/sdf1
Volume group "usb_lvm" successfully extended

# pvscan
PV /dev/sdc1 VG usb_lvm lvm2 [1.88 GiB / 0 free]
PV /dev/sdd1 VG usb_lvm lvm2 [1.91 GiB / 876.00 MiB free]
PV /dev/sde1 VG usb_lvm lvm2 [960.00 MiB / 960.00 MiB free]
PV /dev/sdf1 VG usb_lvm lvm2 [144.00 MiB / 144.00 MiB free]
Total: 4 [4.86 GiB] / in use: 4 [4.86 GiB] / in no VG: 0 [0 ]

source
source2

a RAID made of pendrives

i have two formatted pendrives, 2Gb each.

mdadm --verbose --create /dev/md0 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
mdadm --detail /dev/md0
mkfs.ext4 /dev/md0
mkdir /mnt/usbraid
mount /dev/md0 /mnt/usbraid/

and a little fun

# time dd if=/dev/urandom of=garbage bs=1M count=3
3+0 records in
3+0 records out
3145728 bytes (3.1 MB) copied, 0.687779 s, 4.6 MB/s

real 0m0.691s
user 0m0.000s
sys 0m0.692s
---------------------------------
# time dd if=/dev/urandom of=garbage2 bs=1M count=10
10+0 records in
10+0 records out
10485760 bytes (10 MB) copied, 2.29229 s, 4.6 MB/s

real 0m2.295s
user 0m0.000s
sys 0m2.292s

and then

#mdadm --stop /dev/md0
mdadm: stopped /dev/md0

# mdadm --verbose --create /dev/md0 --level=0 --raid-devices=2 /dev/sdc1 /dev/sdd1

repeat procedure
source

building mplayer2 in debian

apt-get install libxv-dev libasound2-dev libfreetype6-dev libfontconfig1-dev
apt-get install libavutil-dev libavcodec-dev libavformat-dev libswscale-dev libpostproc-dev
apt-get install autotools-dev automake autoconf yasm

git clone git://git.mplayer2.org/mplayer2-build.git
./init –shallow
./update
./make -j 6
(apt-get remove mplayer)
(make install)

—–
after a few weeks playing with mlayer2 I’ve decided to upgrade the repository:
./update
gave me the following error:

tatico@tortuguita:~/codigo/mplayer2-build$ ./update
Updating 90e07b3..5079c04
error: Your local changes to the following files would be overwritten by merge:
README
Please, commit your changes or stash them before you can merge.
Aborting

so I did a:

tatico@tortuguita:~/codigo/mplayer2-build$ git checkout -- README

then ./update worked!

let's make things clear

I publish this blog just for fun, and most of the information you will find comes from my google research and some of the books I have at home. I’m not intending to explain things, only make available the results of things i’ve done and tested for my own personal use.

If this method offends a certain “over qualified” audience, the only effort to assume is to avoid reading this blog.
I’ve not studied anything related to informatics, I’m a self taught Linux user. In my beginnings I had to face unix systems with little or no idea of what I was doing and my only intention with this blog it to make it easier (event a the cost of misleading imprecisions) for people that is discovering this particular and remarkably amazing world of OSes.

Have a nice day.