Valutazione attuale: 0 / 5

Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva

Well...before using LVM, I was using a fixed..normal partition. After I moved to a Raid 1 (mirroring) data partitions.
Now that I'm changing my hard-drives, I need to resize these partitions without lost datas.
Here a little how to:

1. Check the used partition with:

cat /proc/mdstat

will result something like this:

Personalities : [raid1]
md0 : active raid1 sda2[0] sdb2[1]
52453114 blocks [2/2] [UU]

2. Before removing the first partition we need to take it out of the raid:

umount /dev/md0
mdadm --manage /dev/md0 --fail /dev/sdb2
mdadm --manage /dev/md0 --remove /dev/sdb2
mdadm --detail /dev/md0

3. Now it's time to remove the sdb drive (second), and put the new one. Remember to recreate the partitions on the new hard drive (the data will be sync after) with the new size.
4. Let's add this new partition now:

mdadm --manage /dev/md0 --add /dev/sdb2

Then wait the sync will stop, you can check by typing:

cat /proc/mdstat

5. Let's do the same with the other drive:

mdadm --manage /dev/md0 --fail /dev/sda2
mdadm --manage /dev/md0 --remove /dev/sda2

6. Change the first drive, recreate the partition WITH THE SAME SIZE OF THE OTHER NEW DRIVE!!!

mdadm --manage /dev/md0 --add /dev/sda2

7. Now, the data are ok but we need to tell our system that the size is changed:

mdadm --grow /dev/md0 --size=max
e2fsck -f /dev/md0
resize2fs /dev/md0
e2fsck -f /dev/md0
mount /dev/md0

Done, easy enough, isn't?
Bye

P.S: remember to do a backup of your data!!!

Valutazione attuale: 0 / 5

Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva

Today I've got a request to sync files from Motorola V3 Razr with a lenny.
I have tested it with a lenny with all updates and a custom vanilla kernel 2.6.32.3

Step by step:

1) apt-get install moto4lin
2) chmod u+s /usr/bin/moto4lin
3) run moto4lin as normal user (NOT ROOT)
4) Run the command:

lsusb | grep -i moto

will give you a reply like this:

Bus 004 Device 005: ID 22b8:4901 Motorola PCS Triplet GSM Phone (P2K)

Cause the ID must be wrong read from moto4lin we'll need to change something...

5) In moto4lin as user click on "preferences" and set:
ACM Device: /dev/ttyACM0
AT Vendor ID: 22b8
AT Product ID: 4902
P2k Vendor ID: 22b8
P2K Product ID: 4901
We are setting a PID right for p2k and 'wrong' for at, in this way we are making it working in a compatible way.

6) Click on OK
7) Connect the motorola and wait some seconds
8) Click on 'connect' and 'update list'

That's all!

Valutazione attuale: 0 / 5

Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva

Here's my five cents:

- install firefox
- install vlc and mplayer with full plugins supports
- install w32codecs
- install mozilla-mplayer, mozilla-plugin-vlc (for audio/video support)
- install gimp-plugin-registry, mozilla-openoffice.org, mozplugger (for application/documents/photo support)
- install flashplugin-nonfree-extrasound (or install the flash player official, and link the libflashplayer.so in your plugins folder of your firefox)
- install timidity if you want synth music file played into your firefox- disable all totem plugins (they always go wrong to me)
- install java last version, and link the file libnpjp2.so in your firefox plugins folder.

To test all use these links:
audio/video page tester

flash player tester

java virtual machine test

Mozplugger is an extension that permit your favourite program to integrate into your firefox. You can modify the mime-associations by editing /etc/mozpluggerrc

For shokwave you'll need to install wine, the windows version of shockwave player in wine and then set the mozplugger to use it...not really fun :-P

Bye!

Valutazione attuale: 0 / 5

Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva

Debian and Ubuntu users using raid software may get some problems the first Sunday of every month.
This is caused by a scheduled job in crontab (/etc/cron.d/mdadm) running:

57 0 * * 0 root [ -x /usr/share/mdadm/checkarray ] && [ $(date +\%d) -le 7 ] && /usr/share/mdadm/checkarray --cron --all --quiet

The system may became really slow getting some minutes to reply to a simple click.
The easy way is to comment that line, but if you want to leave the check of consistence of array maybe is not a so good idea...let's solve it.

This "bug" is caused by an error while setting the array...
There is a default setting of array that set the bandwidth of scsi/raid to 200Mb/s...did you ever saw and hard disk not using all the cpu with a so high performance? Well, we could so now limit it to more reasonable value by (50Mb/s):

sysctl -w dev.raid.speed_limit_max=50000

And setting it also on boot by adding to /etc/sysctl.conf

dev.raid.speed_limit_max=50000

Byeee ;-)

Valutazione attuale: 0 / 5

Stella inattivaStella inattivaStella inattivaStella inattivaStella inattiva

Since Linux use ext3, you'll have constantly write to disk cause it's a journalized file system.
When you'll get your new 20$ silent fan, and lost much more life time trying to avoid noises around your head, this will be yet stressing. But Linux it's Linux, let's walk how it's possible to relax your stressed disk too :)

Utilities: iotop, it's wrote in python, RHEL/fedora yet don't want to support it.......how could a sysadmin full analyse a so good distribution like RHEL? bah...luckily I  use Debian at home!

apt-get install iotop

run it, after you have saw your normal process writing to disk, you'll see a kjournald every X seconds...don't try to kill it, it's a healthy process and Linux doesn't permit you this...

Three things you can do is: set noatime, disable polling to removable storage devices, and relax the write time.

1) Edit your mount-point:

vi /etc/fstab

set every line of physical disk by adding the noatime option:

/dev/sda1       /boot           ext3    defaults,noatime        0       2

Remount the device (or reboot, how you want):

mount -o remount /boot

2) Disable polling on unwanted auto-mount devices:

ps -ef | grep polling

you'll get the list something like this:

root      5228  5151  0 16:47 ?        00:00:00 hald-addon-storage: polling /dev/sdc (every 2 sec)
root      5230  5151  0 16:47 ?        00:00:00 hald-addon-storage: polling /dev/sdd (every 2 sec)

disable them using:

hal-disable-polling --device /dev/sdc
hal-disable-polling --device /dev/sdd

in case you'll want to re-enable use:

hal-disable-polling --enable-polling --device /dev/sdc

Miss yet something...

Relax the pdflush writebacks daemon that write data to disk (default is 500, 5 seconds):

echo 1500 > /proc/sys/vm/dirty_writeback_centisecs

There is yet something writing on your disk? Enable debugging (make a lot of log writing, make attention to disable fast):

echo 1 > /proc/sys/vm/block_dump

and to disable

echo 0 > /proc/sys/vm/block_dump

If you have enabled kernel.debug in your syslog, you'll found the output into the /var/log/debug.log

Then..maybe enable some other laptop-mode kernel settings:

echo 2 > /proc/sys/vm/laptop_mode
echo 60 > /proc/sys/vm/dirty_ratio
echo 1 > /proc/sys/vm/dirty_background_ratio
echo 60000 > /proc/sys/vm/dirty_expire_centisecs
echo 60000 > /proc/sys/vm/dirty_writeback_centisecs

To make these settings working after a reboot remember to set them also in the /etc/rc.local or set the appropriate variable in /etc/sysctl.conf (for ex. vm.block_dump = 0)

That's all...for now..I think I'll update soon this post...time to dinner now ;-)