preload
Jan 31

Nice way to look users who are using too much memory / cpu.

# ps -eo vsize,pcpu,pid,user,args | sort -k 1 -r | head -10

More options from ps manpage.

Jan 22

So sometimes linux can’t automaticly start array from array members. So lets do it manually.

Get the info from array member (disk partition)


[root@sirius ~]# mdadm --examine /dev/hda1
/dev/hda1:
Magic : a92b4efc
Version : 00.90.01
UUID : b2d657f5:b881d26d:e249f8e9:a64f1406
Creation Time : Sat Jan 14 17:00:14 2006
Raid Level : raid1
Device Size : 1003904 (980.54 MiB 1028.00 MB)
Array Size : 1003904 (980.54 MiB 1028.00 MB)
Raid Devices : 2
Total Devices : 2
Preferred Minor : 0

Update Time : Thu Jan 18 18:07:52 2007
State : clean
Active Devices : 2
Working Devices : 2
Failed Devices : 0
Spare Devices : 0
Checksum : 26a507ac - correct
Events : 0.224

Number Major Minor RaidDevice State
this 0 3 1 0 active sync /dev/hda1

0 0 3 1 0 active sync /dev/hda1
1 1 3 65 1 active sync /dev/hdb1

As you can see that we can get lots of information from disk, but we are only intrested on UUID which identyfies the array member:


[root@sirius ~]# for i in a b; do mdadm --examine /dev/hd"$i"1 | grep -i uuid; done
UUID : b2d657f5:b881d26d:e249f8e9:a64f1406
UUID : b2d657f5:b881d26d:e249f8e9:a64f1406

So partitions hda1 and hdb1 seems to have same UUID which means that they are from same array.

And now lets start the array from those members:


[root@sirius ~]# mdadm --examine /dev/hda1 | grep UUID | awk '{ print $3 }' > /tmp/hda1
[root@sirius ~]# mdadm -A --uuid=`cat /tmp/hda1` /dev/md0

Touché.