Xen 4 Ubuntu 10.04 Self Virtualization

Posted in Uncategorized on March 6th, 2011 by admin

After experimenting with XenServer at work wanted to delve in deeper.
Wanted to maintain existing md raids arrays, with out having to create images or lvm groups of existing storage, because I already had good speed and redundancy, raid 10 f2, around 100MBytes/s writes and 200Mbytes/s reads
So the course I took was to go with Xen 4, and use Debian 6 for Dom0
I already had full backups of my server setup and had several vbox vm’s running, first i converted my vbox hd’s to raw disk, google it
then I installed over / and /boot with debian 6, all my data is on different arrays
/music
/Virt
/dumps
I gave /Virt to dom0 for disk storage and went about getting everything setup.
Create several directories to make my life easier
/Virt/Disk
/Virt/Config
/Virt/Template
because its easier to spell out then /etc/xen and /var/……images/
I then just create symlinks of configs to /etc/xen and /etc/xen/auto
I originally couldn’t get libvirtd to work properly with debian 6 and xen 4, but found that doing it by hand worked alot better anyway.
To do the ubuntu restore I used a template to create a basic ubuntu setup like so
set up my options for xen-create-image (read the man)
xen-create-image –hostname whatever lucid (or whatever version your using)
Then I copied the image, this is the one I restore, then editied the config it generated by hand, set the parameters I wanted, I added the other too md array for
/music and /dumps
as well as the copy of the raw disk
so something like this
disk [
'file:the_one_from_the_script,xvda1,w',
'file:the_copy_to_restore_to,xvdb,w',
'phy:/dev/md2,xvdc,w',
'phy:/dev/md3,xvdd,w',
]

Then i booted it up, (note I also used pygrub so i wouldn’t have to pass an internal kernel)
I did a quick apt-get install dump
then mount /dumps
then mount /restoredestination
then cd into the restore destination, restored my full backup over top of the existing ubuntu install made sure not to restore /dev and /proc for somereason this method works, can’t get linux to do a raw restore with dump for some reason, works great on bsd though
Then I mount /dev bind and /proc in the restore destination, i chroot in and remove all the virtualbox stuff, then I install a virtual kernel think its something like
apt-get install linux-image-virtual
but a apt-cache search linux image virtual should give a better result going off memory here
also edited fstab, I use uuid cause its safer in my experience then trying to say xvda or sda1 or hda1 or what ever
ls -lh /dev/disk/by-uuid should fill you in
shutdown the vm, edited the disk portition of config and removed the first line making sure the main disk was on the first line
I also setup dynamic memory in the config.

I haven’t yet, but I’ll probably just do a file level swap, which is easy enough to do
could also just add it to config file, if you use the above it can automate this for you

some interesting benchmarks, the first one is an image on a raid 10 f2 configuration rated to around 200r/100w MB/sec, but the results are probably due to file caching
The other two are phycial md arrays, raid 10 rated to 100r/100w MB/sec

ron@server:~$ sudo hdparm -t /dev/xvda

/dev/xvda:
Timing buffered disk reads: 1088 MB in 3.00 seconds = 362.36 MB/sec
ron@server:~$ sudo hdparm -t /dev/xvdb

/dev/xvdb:
Timing buffered disk reads: 368 MB in 3.01 seconds = 122.41 MB/sec
ron@server:~$ sudo hdparm -t /dev/xvdc

/dev/xvdc:
Timing buffered disk reads: 336 MB in 3.02 seconds = 111.27 MB/sec

Gimp (GNU Image Manipulation Program)

Posted in Linux, Uncategorized on February 6th, 2011 by admin

Did these with Gimp, well except the last 2 picture


http://www.facebook.com/album.php?fbid=492347016225&id=535681225&aid=265127

New Case For Server

Posted in Uncategorized on February 4th, 2011 by admin

Got the Azza Horrican 2000, waiting on 2 more hotswap boards and a spare (got em for 3 bucks a pop) but just finished putting the grill on the cpu fan and here are the before and afters. Decided to get this after installing new raid array and breaking the backup drive in the process. Had to superglue the sata port back together, holding out so far..

Fragmentation

Posted in Uncategorized on January 22nd, 2011 by admin

A good bit of a system slowing down over time is related to the hard drive, the slowest part of any computer, their are several levels to this that can effect performance, file level fragmenation, free space fragmentation and mft fragmentation. File level is usually all you have to look at but when your disk begins to fill and you have lots of small files (temp internet) your mft can fragment causing extreme speed loss and possible crash (on workstations at least, not suppose to be an issue on nt6+ vista or higher, 2008 or higher)

Some good tools to deal with this are defraggler and smart defrag. defraggler is great at file level fragmentation but that about where it ends. smart defrag however has alot of the feature of premium products such as boot time defrag (to defrag system files that are normally locked during normal operation, reg hives, mft, system dll’s). It also offer contiuous defragmentation which runs defrags when system usage is below a specified level. Both these products offer the ability to easily schedule defrags to run at off hours.

Server fragmentation can slow down an entire network so its always a good idea to stay on top of these, both of these program will work, would not use the auto feature on a server though, and be sure to put in exceptions for things like database files and database backup files. Since these are going to always be fragmented. But if you follow best practices with disk fragmenation you can minimize the amount that they will fragment. Both of these will allow single file defrag and files this comes in handy for are outlook datafiles and sql database files, you need to close outlook or sql to run these to remove the file locks, and especially with sql you need to make sure their is enough continous free space for the defrag to have any effect. So running regular defrags before attemping sql defrag, or exchange defrag (see microsoft kb article not recommened to use these tools on stores) will provide better results.

For those interested, you can also check fragmentation on linux system, and if your so inclined recompile your kernel and compile the defrag tools for ext4. Or just wait a few more years for these tools to make it into mainstream releases.

for software raids

sudo e2fsck -nfv /dev/md0 (number of the md device)

regular scsi disk (most kern now see sata as scsi)

sudo e2fsck -nfv /dev/sda1 (letter of device and number of partition)

system that see your disk as ide

sudo e2fsck -nfv /dev/hda1 (letter of device and number of partition)

http://www.iobit.com/iobitsmartdefrag.html

http://www.piriform.com/defraggler

Server supported defrag solutions that will provide continuous and idle defrag and further fragmentation protection

http://www.iobit.com/iobitsmartdefrag.html

http://www.diskeeper.com/business/diskeeper/server/default.aspx

The only exception to this rule is SSD you do not defrag SSD and in system with SSD such as 2008 R2 or windows 7 you should disable the defrag service and manually defrag any conventional disk.

NTFS is not much better off at dealing with this then FAT32, the real benifit with NTFS is longer file names, larger files, file system journaling

Virtualization is also not immune to fragmentation, and when hosting vm’s on windows, make sure you always allocate all space at the creation of a virtual disk, then check fragmentation level of the allocated disk prior to first boot, if you allocate at once, and insure fragmentation of the file is within reason you won’t have to worry so much about dual level fragmentation between the host and guest os. You will however still need to consider guest level fragmentation of your virtual machines.

With Pagefile fragmentation, you can avoid this all together by calculating a safe size for your pagefile in advance, which is usually recommended to be 1.5x phycial memory, setting it to allocate the entire size from the start will ensure it does scrink and grow  and risk fragmentation.

Keeping up with file level fragmentation can also reduce the chances of registry hives becoming heavily fragmented, their is however a special tool for checking these hive files and boot time defragging them if needed.

http://technet.microsoft.com/en-us/sysinternals/bb897426

Tags: , , , , , , , ,

Keys to faster Samba Server(linux)

Posted in Uncategorized on December 5th, 2010 by admin

Firstly, and can’t stress this enough, is wins

I’m sure theirs a way to make dns work on a peer-to-peer network more effectively, maybe some reg edits here and their but on standard windows pc, which you can usualy assume, WINS, is going to be the best bet.

First set your samba server to be the master wins server, these options have worked best for me
#WINS SHIT
#Just cause i like a sure thing
os level = 99
# well this is needed
wins support = yes
name resolve order = wins lmhosts hosts bcast
domain master = yes
preferred master = yes
#Because I auth to a local ddns server with my dhdns proxy = yescp server
#the following helps with peer-to-peer traffic
dns proxy = yes

The above pretty much guarantees your be the WINS master server.

Now onto dhcp, because I just don’t like dicking with wins
option netbios-name-servers SAMBASERVERIP;
option netbios-node-type 8;

This will help increase the access time of your windows clients to your samba server, pretty much instant. \\hostname and bam, also speeds up windows – windows, network neighhood(network i guess is what its called now)

To increase the speed on the samba server even more I increase the buffer size and set some socket options
socket options = TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384

Tags: , , , , , ,

layering

Posted in Uncategorized on November 28th, 2010 by admin

New setup for stupidflander.org little insite into how it was done

Tags:

Upgrade Ubuntu 10.04 32-bit to 64-bit (server)

Posted in Uncategorized on November 27th, 2010 by admin

Theirs no straight forward way about it. You have to install from scratch, but you can an in place upgrade, sort of.
The first step is to get to the version of 64 bit you want to run on your 32bit system, then get up to date. Next your want to run a backup of your entire system, one that will preserve the entire system symlinks and perms, etc. dump comes to mind
Next back up again to a different media, last thing you want is to start your restore only to find out you forgot something.
Next your want a dump of everything installed on your system.
dpkg --get-selections > install.txt
Download install.txt your want to look it over and figure out what you installed and what is a depency of what you installed, this could take awhile and you could just go in and do
apt-get install `cat install.txt|awk '{print$1" "}'|tr -d '\n'`
but then your going to mark everything as install and it won’t distinguish between dependencies and removing or replacing anything will quickly become a nightmare. So go though it and figure out what needs to be reinstalled.
cat install.txt|grep -v

Your want to do a dump of any db’s your hosting, i could be wrong here, but in my experience when switching architecture you can’t just grab the db’s out of var and throw them on the new system they have to be restored, again ymmv, but just incase do a dump.

install the 64 bit version, then before rebooting df should tell you where your new file system is mounted, chroot into it, reinstall your applications, a good start would be to rerun
dpkg --get-selections > install2.txt
and do a
diff install2.txt install.txt
once you have that done reboot into your now 64 bit system
run updates
Again ymmv, but i’ve had pretty good luck with this method going from solaris (was quiet a bit more envolved, had to convert formats on pretty much every config) to openbsd, then switch over to ubuntu, now getting ready to switch over to ubuntu 64, need more memory and gotta make the jump back to 64.
first thing restore /etc, now careful here, if your just doing 32 -> 64, should be ok, theirs shouldn’t be any major format changes to config files, and more then likely your not going to want to change much in etc from your old system, this will also pull in all your old users and password
then restore /home /root and possible /opt /var/www /var/mail and depending on what else you were running and were you stored data their could be more
your want to check and make sure your fstab is setup correctly if you formatted your parts your need to update the uuid, and you can find this in dev, google it
a reboot and you should be back where you left off, only 64-bit, theirs probably going to be more to do to make sure your stable, but a quick glance at dmesg and syslog will probably point out any thing you missed, and if you have to can always restore to a dif disk and boot to that to figure out what your missing.

Workstation, just run gparted, offload /home to a dif partition and then reinstall, before restart, ctl+alt+f1, df to see where your mounted, chroot in,
mv /home /home.bak
mkdir /home
vi /etc/fstab

put in mount point for /home partition
you can also use the
dpkg --get-selections
prior to install and get an idea what will need to be reinstalled, but all your personal settings will come over.

Tags: , , , , ,

Wtf, Sun Blade 1000 Welcome Video

Posted in Uncategorized on November 5th, 2010 by admin

Found this on youtube. WTF

From the same people that made a purple workstation, so go figure, they’d make a video to go with said purple workstation.

Tags: , ,

Sun Blade 1000 / Linux

Posted in Uncategorized on October 4th, 2010 by admin

So I’ve searched the internet for a cheat sheet, closes I find is users using sata pci cards and booting off those.

Now this didn’t seem like an option to me cause I’ve already added usb and GbE to the PCI bus and already have an excess of FC-AL drives I got off ebay for next to nothing (guessing they were someones spares left over after retiring a server)

So I tried again to install debian during install it ask for EDIT THIS q22xxx.bin firmware. So I googled it. Nothing. So I decided to dig a little dipper. EDIT DETAILS

lspci
and
lsmod
Gave me enough information to then google and find that EDIT qlogic doesn’t do opensource firmware so firmware was proprietary. Also found that in dmesg it gives an ftp site to download said firmware. But better yet apt-cache search EDIT qlogic yields that in the non-free repository this be the firmware. So I download it, setup networking in the install, pull the extracted firmware from my main system over http and put it in /lib/firmware rerun the scan and good to go.

I ended up doing an install. Setting up a degraded raid on my second drive, migrating the install then initalizing the raid on first boot.

Didn’t want to wait for the intial raid to setup so I took a short cut.

Sound was also a bitch to get working tried to manually add the kernel module with modprobe then rerun alsa scan, still didn’t take then ran EDIT alsaconf and was good to go.

Ended up installing the debian desktop under tasksel then switched it to xfce4 and xdm.

Tags: , , , , , ,

Solid State Store, Cheap and Fast Use DDR3 Memory, Linux and mdadm

Posted in Uncategorized on September 28th, 2010 by admin

So you want to have extremely fast storage. You also don’t have a boat load of money sitting around to do it with. Well I have a solution. I’ve been experimenting with mdadm and /dev/ram on my system the size of memory disk are 64MB so for testing I’ve created a raid array to see just how fast my memory would act as a ram drive.

#sudo mdadm –create /dev/md3 –level=0 –raid-devices=8 /dev/ram0 /dev/ram1 /dev/ram2 /dev/ram3 /dev/ram4 /dev/ram5 /dev/ram6 /dev/ram7
mdadm: metadata format 00.90 unknown, ignored.
mdadm: metadata format 00.90 unknown, ignored.
mdadm: array /dev/md3 started.
#sudo mke2fs /dev/md3
#sudo mount /dev/md3 /mnt/
#df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/md3              496M  2.3M  468M   1% /mnt
So I get just about a 500 meg ram disk. So then running the following command yield rediculous speeds. Even when were talking about 500megs. Their are easily affordable system with 16gigs of ram, creating a 12gig wouldn’t be that hard to create. Might need to increase the size of ram disk but still. Once you see these numbers. Well here they are.
I did the first test with 4 ram disk in a raid 0. Here are the results.
#/opt/1$ sudo hdparm -t /dev/md4
/dev/md4:
Timing buffered disk reads:  254 MB in  0.34 seconds = 743.04 MB/sec
#/opt/1$ sudo hdparm -t /dev/md4
/dev/md4:
Timing buffered disk reads:  254 MB in  0.35 seconds = 734.65 MB/sec
Now like above I redid the test with the 8 ram disk in a raid 0.
/dev/md3:
Timing buffered disk reads:  510 MB in  0.54 seconds = 936.91 MB/sec
/dev/md3:
Timing buffered disk reads:  510 MB in  0.54 seconds = 937.48 MB/sec
Running the same test on a 500gb plater Seagate 7200.12 I get
#sudo hdparm -t /dev/sdb1
/dev/sdb1:
Timing buffered disk reads:  376 MB in  3.01 seconds = 124.93 MB/sec
Thats a 10x improvement when compared to a regular harddrive. Their are probably other factors to consider.
But one thing this tells me is that I could create a ram disk raid it and then sync data to it that I need to be able to read at a ridiculously rate. With more memory their are more possibilities. Now if only the hardware solution to this wasn’t so ridiculouslyy over priced.
With out the raid I got even better performance you can adjust the size of ram disk, but I haven’t experimented with it my self.
~$ sudo hdparm -t /dev/ram0
/dev/ram0:
Timing buffered disk reads:   64 MB in  0.04 seconds = 1469.95 MB/sec
:~$ sudo hdparm -t /dev/ram0
/dev/ram0:
Timing buffered disk reads:   64 MB in  0.04 seconds = 1711.82 MB/sec
:~$ /dev/ram0:
Timing buffered disk reads:   64 MB in  0.04 seconds = /dev/ram0:

Timing buffered disk reads:   64 MB in  0.04 seconds = 1637.50 MB/sec
ron@router:~$ sudo hdparm -t /dev/ram0
/dev/ram0:
Timing buffered disk reads:   64 MB in  0.04 seconds = 1568.40 MB/sec

MB/sec

$ sudo hdparm -t /dev/ram0
/dev/ram0:
Timing buffered disk reads:   64 MB in  0.04 seconds = 1568.40 MB/sec
Tags: , , ,