Monitoring filesystem activity under Linux with block_dump 
sudo sysctl vm.block_dump=1


echo 1 > /proc/sys/vm/block_dump

tail -f /var/log/kern.log

[ view entry ] ( 2909 views )   |  print article
ntfs read/write with feisty 
apt-get install ntfs-g3


vol_id /dev/sda1

UUID=5EFC7B02FC7AD42D   /media/usbhdd ntfs-3g rw,users,uid=1000,guid=1000,umask=007,locale=de_AT.utf8,force   0    0
user can mount but not unmount

wget ... ount.patch

$ sudo apt-get update
$ sudo apt-get install build-essential
$ sudo apt-get build-dep mount
$ cd /tmp
$ apt-get source mount
$ cd util-linux-2.12r
$ ./debian/rules patch
$ patch -Np1 -i ../util-linux_user_mount.patch
$ ./configure
$ make lib
$ make -C mount
$ sudo chown root:root mount/umount
$ sudo chmod 4755 mount/umount
$ sudo mv mount/umount /bin

automount with udev:

BUS=="usb", KERNEL=="sd*", SYSFS{serial}=="DEF10000CC2DAB6", NAME="%k", run+="/bin/mount /media/usbhdd"

[ view entry ] ( 1341 views )   |  print article
serial (ttyS) over TCP 
First computer where to redirect serial via TCP:

stty -F /dev/ttyS0 raw 9600 -echo
nc 1111 >/dev/ttyS0 </dev/ttyS0

Second computer receiving needs 2 serial's
stty -F /dev/ttyS0 raw 9600 -echo
stty -F /dev/ttyS1 raw 9600 -echo

nc -l -p 1111 >/dev/ttyS1 </dev/ttyS1

Now a programm can connect to /dev/ttyS0 and talks to out first computer.

[ view entry ] ( 1751 views )   |  print article
raid1 with ubuntu feisty 

What i want from a raid1:

notiy if a disk fails

This is done by mdadm

boot degraded with only one disk

boot degraded does not work with ubuntu, because mdadm does not start a degraded raid :-(

my workaround is to add a bootmenue entry in grub

title           Ubuntu, kernel 2.6.20-16-generic (raid defect)
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-16-generic root=/dev/md1 ro raid_degraded
initrd /boot/initrd.img-2.6.20-16-generic

and make an initrd (update-innitramfs -u) with /etc/initramfs-tools/scripts/init-premount/raid_degraded


set -eu


echo "$PREREQ"

case ${1:-} in
exit 0
. /scripts/functions

if [ -e /scripts/local-top/md ]; then
log_warning_msg "old md initialisation script found, getting out of its way..."
exit 1

MDADM=$(command -v mdadm)
[ -x $MDADM ] || exit 0

if grep raid_degraded /proc/cmdline 2>/dev/null; then
echo "MD_DEGRADED_ARGS=' '" >> /conf/md.conf

exit 0

reported to ubuntu

easy change disk if one disk fails

Threrefore i made a script doing partitioning, adding to raid and installing bootloader of the new disk


if grep -q sda /proc/mdstat; then

if ! sfdisk -l 2>/dev/null | grep -q $SRC_DISK; then
echo $SRC_DISK not found
exit 1

if ! sfdisk -l 2>/dev/null | grep -q $DST_DISK; then
echo $DST_DISK not found
exit 1

sfdisk -d $SRC_DISK | sfdisk $DST_DISK

mdadm /dev/md0 -a ${DST_DISK}1
mdadm /dev/md1 -a ${DST_DISK}2

cat /proc/mdstat

/usr/sbin/grub --batch --device-map=/dev/null <<EOF
device (hd0) $DST_DISK
root (hd0,1)
setup (hd0)

exit 0

set uuid

ubuntu cannot boot if any uuid of any disk is different - solution set uuid:

mdadm --stop /dev/md0
madmd --assemble --verbose /dev/md0 /dev/hda1 /dev/hdb1 \
--update=uuid --uuid=xxxxxxxx:xxxxxxxx:xxxxxxxx:xxxxxxxx

newer versions of mdadm should be able to set uuid with --create

why is my raid1 so slow ?

Reading from my raid1 is as fast as a single sata disc:

hdparm -t /dev/sda1

Timing buffered disk reads: 172 MB in 3.00 seconds = 57.27 MB/sec

hdparm -t /dev/sdb1

Timing buffered disk reads: 172 MB in 3.01 seconds = 57.20 MB/sec

hdparm -t /dev/md0

Timing buffered disk reads: 172 MB in 3.00 seconds = 57.29 MB/sec

i tried

* different motherboard with a different sata onboard controller but also the same results

* different ubuntu kernels: 2.6.17, 2.60.20 and from gutsy 2.6.22rc

* different images:
linux-image-2.6.20-16-generic 2.6.20-16.29
linux-image-2.6.20-16-lowlatency 2.6.20-16.29
linux-image-2.6.20-16-server 2.6.20-16.29

* also a raid1 with PATA Disks

reported to ubuntu

can anybody explain me why?

[ view entry ] ( 738 views )   |  print article

<<First <Back | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 |