Archive for January, 2008

LVM progress update cont.

Friday, January 18th, 2008

OK so we’re successfully booted off the new LVM based root filesystem.

Now i want to move everything back onto the dm softraid array. So we delete the old home and root partitions and make them into a new big partition with an LVM label,(I justed yast to do this coz i couldn’t have been arsed looking up the commands.

Now we convert this new big partition into a LVM physical volume:

pvcreate isw_cggibjcgah_Raid_part5

And then add it to the system volume group.

vgextend system isw_cggibjcgah_Raid_part5.

Now we can actually start moving stuff over (on the fly) to the array.

/dev/sda1 is the physical volume we want to release, its currently where root and home is. But this command will move the partitions to any other free physical volumes, which there is only one, the array,  system isw_cggibjcgah_Raid_part5.

pvmove /dev/sda1

But i got an error saying the mirroring module isnt loaded, so we load that:

modprobe dm-mirror

And after this the command will run successfully, It takes a while, depending on the size of your disks.

Now we have a free sda1 physical volume that we can remove out of the volume group.

vgreduce system /dev/sda1

And then make it a non physical volume using

pvremove /dev/sda1.

And that should be it. A successful conversion from standard linux block device to Logical volumes without loosing any data!

Two things to note that may render your system unbootable are these:

  1. Don’t touch your/boot partition/device, grub needs this and cannot read from a logical volume!
  2. Leave your swap space as an ordinary partition too, although the system will attempt to boot even though it cant access any swap space.

LVM progress update

Wednesday, January 16th, 2008

So the resize of /home worked but i couldn’t manage to resize the block device size. So fortunately i had a spare 200gb hard disk, so i made a new volume group and added the new hard disc as a physical volume, i then made two logical volumes on that, one for root and one for home and format them both with reiserfs, the root logical volume i mount on /mnt/tmp and copy the root filesystem with cp -vaRx / /mnt/tmp which seems to work properly, and then the same for root.

My next problem is I cant boot off the lvm because the required kernel modules arent in initrd. so I have to run mkinitrd /dev/system/rootlv from the path of the root file system device it works out what modules are required to allow the kernel to mount the root filesystem. Then /boot/grub/menu.lst has to be updated and /etc/fstab to mount the logical volumes instead of the old physical ones.

Cross your fingers and do an init 6, and hopefully you will have a bootable system off the logical volume.

If your in luck you can now start working on moving the volume group back onto the original hard disks, or in my case the dmraid. I’ll update with that later.

Converting to LVM from standard block devices

Wednesday, January 16th, 2008

Ok, This is going to be a challenge, but I think im up to it. I’m going to convert from using standard linux partitions /dev/sda1 /dev/sda2 etc to an LVM setup, without the need to reinstall. The trouble is I have no free space to put a some physical volume space, so step one is to shrink my 200G /home filesystem to 100G making space for me to copy my root filesystem. So now I have to login as root to be able to unmount /home, and make sure nothing is accessing it. I’m also using dmraid which could complicate the issue.

Because I always use reiserfs I can shrink a partition, it takes time but it does work(crosses fingers).

resize_reiserfs -s -100G /dev/mapper/isw_cggibjcgah_Raid_part6
resize_reiserfs 3.6.19 (2003 www.namesys.com)

You are running BETA version of reiserfs shrinker.
This version is only for testing or VERY CAREFUL use.
Backup of you data is recommended.

Do you want to continue? [y/N]:y
Processing the tree: 0%….20%…. left 14597898, 8996 /sec

This is gonna take a while, will update on my progress tomorrow.

BBC iPlayer woes.

Monday, January 14th, 2008

Well I have to hand it to BBC’s IT team, I’ve spent all evening trying to get iPlayer to work where I am in Dublin and I couldn’t manage it. I tried numerous methods like:

  • Numerous proxies on proxy lists around the web
  • VPNing into my work network(I’m amazed this didn’t work)
  • Just going to the website directly(ye this was a dead horse)

One last thing I could do would be to boot my Laptop into windows because the Linux VPN client isn’t the best, but of course that would mean booting into windows.

Putting a LAMP VPS on a diet

Saturday, January 12th, 2008

Having a VPS with 128M of ram and wanting to run LAMP on it successfully is no mean feat. I wanted a selection of php/mysql based applications to run on the server.

  • Wordpress(naturally)
  • Mediawiki
  • Ampache

At first I installed the vanilla apache2 and mysql packages and fired them up because I had no experience of anything else but by default my apache was using up nearly 30mb of ram and had 5 children, mysql was a similar affair except it used a threaded modal instead.. My memory usage quickly shot up to nearly full capacity pretty quickly. A quick Google later and I came across a guy who has optimized mysql for low memory situations, and I scrapped apache and went for the lighter lighttpd.

Heres the changes I made to my.cnf(mysql).

< key_buffer = 16M
< max_allowed_packet = 16M

> key_buffer = 4M
> max_allowed_packet = 2M
54c54
< thread_cache_size = 8

> thread_cache_size = 3
61,62c61,62
< query_cache_limit = 1M
< query_cache_size = 16M

> query_cache_limit = 2M
> query_cache_size = 128K
96c96
< #skip-innodb

> skip-innodb
120c120
< key_buffer = 16M

> key_buffer = 4M

This left mysql using 2.9% of memory, which for a database is not too bad at all.

I then installed lighttpd which required me to enable the universe and multi verse apt sources, this is because lighttpd is under the BSD license. Of course then I needed to install PHP support, this meant installing the php5-cli package and enabling the fastcgi lighttpd plug in using lighty-enable-mod. Then for some reason lighttpd kept crashing when i tried to start it, I looked in the configuration files and narrowed it down to /etc/lighttpd/conf-enabled/10-fastcgi.conf in which i changed the line “PHP_FCGI_CHILDREN” => “4″, to “PHP_FCGI_CHILDREN” => “0″ and that lighttpd started successfully and to my astonishment all my PHP applications worked out of the box, as before with apache, thats mediawiki, wordpress and ampache and with lighttpd sitting at 0.6% memory usage I was laughing. although php-cgi, which handles all the PHP pages was at 5.6% but thats understandable.

Of course strictly speaking this isn’t a LAMPS configuration now more like LLMPS, but it does the job better!

Ubuntu as a server

Friday, January 11th, 2008

I’m not going to lie, I’ve never been that fond of (k)ubuntu. I find it tries to hide a lot of stuff so users cant break much, but I’ve been pleasantly surprised at how it can become a light streamlined server OS suitable for something like a VPS with limited amounts of ram and disk space.

The install given to me by my provider was just 400MB in size. Granted there was a lot of stuff had to be installed right away like the different shells, vim and even man but it cut a lot of the unnecessary software out thats just not needed on a  server.

dmarkey.com is up and running again!

Friday, January 11th, 2008

Finally my website dmarkey.com is up and running again. It has been a long time since i hosted on our shared DSL line in terenure which it performed well but now it has its own dedicated VPS(Virtual private server) with a whopping 128MB of RAM so dont be too hard on it!

I hope to have a good experience with using a VPS for the first time. The VPS company I’m with is the (dirt) cheap http://www.vpsvillage.com which I’ve bought their $10 dollar a month “hut” off them which gives me an Ubuntu based Linux virtual machine(other distributions available), 128M of dedicated RAM and 8G of dedicated disk space and a whopping 256GB of traffic per month. Plenty for a website like this.

I’m thinking of setting up a cron script to monitor the network reliability to see just how well we are performing, maybe ping it every 10 minutes from my workstation in work or something. To be honest though I’m not expect 99.9% uptime, especially not at $10 a month.


Copyright © 2018 All Rights Reserved.
No computers were harmed in the 0.414 seconds it took to produce this page.

dmarkey.com