Skip to Content

Blogs

Great OSS App Number 2 - sshfs

Continuation of the theme from my previous post  - to attempt to highlight useful OSS apps that are maybe not so familiar, but are extremely useful. The next application I would like to talk about is sshfs.

Ever need to mount a filesystem over the network, but for whatever reason, you cannot use nfs or smbfs? Sshfs allows you to mount an accessible directory from a remote machine using only ssh. Another benefit is that all communication to that mount is encrypted by ssh - making it a secure mount as well.

Install sshfs. It should be apparent to readers of this blog how to install an app on their favourite distro, so I will not go into details on the installation.

To mount a directory using sshfs use the following command - in my case I do it as root :

# sshfs scott@192.168.0.7:/mnt/testraid5 /home/scott/thumpa -o allow_other -o uid=500
# mount
/dev/mapper/Vol1-root on / type ext3 (rw,relatime)
none on /proc type proc (rw)
/dev/md1 on /boot type ext3 (rw,relatime)
/dev/mapper/Vol2-1 on /home type ext3 (rw,relatime)
/dev/mapper/Vol1-usr on /usr type ext3 (rw,relatime)
/dev/mapper/Vol1-var on /var type ext3 (rw,relatime)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
none on /sys/fs/fuse/connections type fusectl (rw)
scott@192.168.0.7:/mnt/testraid5 on /home/scott/thumpa type fuse.sshfs (rw,nosuid,nodev,max_read=65536,allow_other)


If you use key authentication, ensure that you su to root WITHOUT 'su -' and just 'su'



Great OSS App Number 1 - synergy

Thought I would start a series of posts like this to highlight some of the great apps that are maybe not too familiar with the average linux/OSS user. I will start with the synergy application.

Synergy is a command line tool that is used to share one keyboard and mouse across a multitude of machines. The sourceforge page can be found at http://synergy2.sourceforge.net/ It has good documentation and FAQs and is very straight forward to follow.

Synergy is available for most operating systems and works in a client server mode where the server has the physical mouse and keyboard and runs a daemon on port 24800.

The clients connect to the server and can then share that keyboard and mouse. The configuration is very straight forward and is configured by the principal of relative positions to each other i.e.

client is left of server; server is right of client

A great app that is very underated in my opinion. Those who know it and use it regularly will be wondering how people who do not survive without it!

LVM

The logical volume manager. Inconspicuous, unassuming but could quite honestly be one of the most integral parts of the linux OS. For those who have not really cared or taken much notice about the finer points of LVM, then this blog post may change your mind.

LVM can be used in a multitude of ways some of them being -

  • Provide data protection by way or mirroring volumes
  • Provide increased I/O performance by way of striping across volumes
  • Ability to resize and reshape volumes on the fly
  • Provide backup utilities using snapshots

These are a just a few of the benefits of understanding more about LVM. My experience in particular was to create GPT partitions on 22 SAN attached LUNS without losing my data. My LVM metadata was written directly on the LUN rather than a partition on the LUN so I had the problem of now trying to create the partition which required the first 34 sectors which would overwrite the LVM metadata which was situated at the first 4 sectors. Dilemma.

Each LUN was in it's own volume group and the logical volume that the file system sits on, was within that volume group. So the solution here was to add another physical volume to the volume group with the vgextend command and remove the existing one so I could then do what I want with it. It can immediately be seen how this may be benificial to other problems. For example if the problem was to replace the existing disks with bigger or faster disks, then the same methodology would also be relevant.

I now have 2 physical volumes in my volume group and using the pvmove command I could move the extents off the volume I so wish. One piece of advice here though is that this can be extremely time consuming, so it is a good idea to reduce the file system to not much bigger than what is absolutely necessary and in turn reduce the size of the logical volume.

Once the pvmove command is complete, the vgreduce -a command can be executed to remove the physical volume from the volume group. If the physical volume is still in use, vgreduce will inform you that ir is so and therefore will not trash your VG. It is always a good idea anyway to use the -t option (test).

Now that all the extents have been moved to the replacement disk, the old disk can be removed with the pvremove command and then what ever is required to be done with the disk/s can be done. To put back all that needs to be done is the reverse of the process - pvcreate, vgextend to add the disk again and then pvmove the subsitute disk.

Don't forget to lvresize and resize2fs back to the way it was after your done!

Another handy little tip is to keep copies of your /etc/lvm/archive and /etc/lvm/backup directories. Should for any reason you lose the lvm metadata on your physical volumes, then your going to need the above to piece everything back together.

Site Upgrade & New Theme

Well folks, if you're a regular visitor to our site, you'll notice things are slightly different. Yep, we have a new look and feel! And that's not all that's new...

Under the hood, we're now running Drupal 6.x, the latest stable release. It provides a few new bits and bobs that will help us to manage the site, and you to use the site.

We've also recently gotten the wiki up and running. Please don't be scared to contribute content, a wiki is only successful when everyone lends a hand.

Have fun!

Mandriva 2009 Upgrade

A little while back I decided that enough was enough. No sooner do I get to grips with the latest release of fedora, another one is churned out from those people Redhat. Now, I don't really have a problem with new releases. Secretly we all love having bleeding edge software running on our desktops. How many hours did you spend getting compiz/beryl to work as soon as you saw it for the first time. Software bling is a must - certainly for me anyway. But here is the sticking point. I do not want to have to re-install my machine everytime fedora pops out distros. So I decided to throw Mandriva 2008 on my laptop, knowing that very soon I will be able to upgrade to 2009.

A little while back I decided that enough was enough. No sooner do I get to grips with the latest release of fedora, another one is churned out from those people Redhat. Now, I don't really have a problem with new releases. Secretly we all love having bleeding edge software running on our desktops. How many hours did you spend getting compiz/beryl to work as soon as you saw it for the first time. Software bling is a must - certainly for me anyway. But here is the sticking point. I do not want to have to re-install my machine everytime fedora pops out distros. So I decided to throw Mandriva 2008 on my laptop, knowing that very soon I will be able to upgrade to 2009. I know the Gentoo zealots are going to tell me that they upgrade everytime they emerge. But what I need is an rpm based distro that I can use for every day purposes and when the need arises, I can upgrade without fear of fail.

Well I upgraded last night to Mandriva 2009, and 1659 packages later + the additional 250+ for KDE 4, I am sitting here with a shiny new distro on my new laptop.

What a joy. Everything bar a few minor little bugs seems to be in order.

The upgrade itself was a little hacky due to the auto upgrade applet being administratively disabled for a day or so to iron out a few bugs. So i did it the manual way of removing all the media and then obtaining the new media.and then upgrading.

# urpmi.removemedia -a
# urpmi.addmedia --distrib http://mirrors.telkomsa.net/pub/linux/mandriva/official/2009.0/x86_64/
# urpmi --auto --auto-select --replacefiles 2>&1 | tee upgrade.log

My initial impression of kde4.1 is thus far positive. I had purposely not touched the baby-eating 4.0 version but there are some nice features in 4.1 which will come in handy for me and the look and feel is great.

But for me the fact that everything which worked for me on 2008 seems to have no issues now it has been upgraded to 2009. As well as a in a personal capacity, I, like many others, use linux as a tool to do my work and I cannot really afford to re-install my OS every six months. It has become necessary for me to be able to upgrade my distro without fear of borkage and therefore the decision to move from Fedora after 5 years and nearly 10 versions, to Mandriva has been vindicated so far.

It has made me wonder - are users of FOSS are becoming a little picky? I have found myself instead of just being grateful that something works to now being a little bit more demanding. There is nothing wrong with the Fedora distro in my opinion, its just that I don't really want to backup everything, re-install and then restore data. It's too much effort. Is this right though to be fussy over something that I can effectively have for free? Its kind of like being given free cake and then deciding that don't want THAT cake - you need cake that has more sugar/cream/iron filings in it.

http://wiki.mandriva.com/en/Home

The RPM Debate

I am not even going to kid myself that I am an RPM expert, but I have built my own rpms, I know what macros are for and I know that I can build source rpms without having to have escalated priviledges (mostly). Neither am I an expert on all the other various package management technologies, but the war raging on -tech got me thinking that I cannot understand what the fuss is about and as a result, I want to put forward my experiences.

I am not even going to kid myself that I am an RPM expert, but I have built my own rpms, I know what macros are for and I know that I can build source rpms without having to have escalated priviledges (mostly). Neither am I an expert on all the other various package management technologies, but the war raging on -tech got me thinking that I cannot understand what the fuss is about and as a result, I want to put forward my experiences.

I can still remember my first installation of linux - it was in 2000 and I was handed a copy of RH6.2 - w00t! I duly installed said OS, not really having a clue what I was doing or what the OS was up to, but I bumbled and stumbled on and at some stage my external modem dialed up and connected to the internet - result. I do not really remember a lot about that distro in those days, but I do remember explaining to a buddy of the nightmare I was having trying to install stuff. He immediately informed me of 'Dependency Hell'. This has now become a term that has seemed to have stuck with anything relating to any problem where ever there is RPM involved. I must admit that it was too much work for me to try and determine what dependencies were missing and to be truthful, I had no idea what I was doing, therefore installing applications was a no-no. Speaking to people nowadays, it seems that this was not a problem limited to noobs such as myself.

I then left linux for a brief period and entered the dark and mysterious world of BSD, playing around with Free & Open before being introduced to Gentoo. With the familiarity of the ports setup and the fact that shit worked under linux, I was hooked. I installed Gentoo linux and was amazed by 'the control' I had. I was amazed that I was compiling my compiler to be more uber optimal at compiling. Total l337 h4x0r, me! Gentoo worked. Applications installed and all was well. I did not mind that everything had to be compiled every time or the fact that it was bleeding edge, i was just happy that everything was working and working to what I believed was total, optimal l337ne55 ... As the years went on, my interest for compiling everything slowly, but surely, started to wane. I started moaning that I could not do anything until X had recompiled and when open office came along with a new version, I would effectively down tools and try to think of activities I used to do before computers and the internet. Only to find out that there was not much... So the machine would be crunching away at night and in the morning I would have the latest greatest software. I believe that there are still pseudo awards for who people who have installed Gentoo from stage 1 on the slowest machines... Masochists!

Just like to add here a quote from Insomnia in #solaris some years back:

<@insomnia> it only takes three commands to install Gentoo
<@insomnia> cfdisk /dev/hda && mkfs.xfs /dev/hda1 && mount /dev/hda1 /mnt/gentoo/ && chroot /mnt/gentoo/ && env-update && . /etc/profile && emerge sync && cd /usr/portage && scripts/bootsrap.sh && emerge system && emerge vim && vi /etc/fstab && emerge gentoo-dev-sources && cd /usr/src/linux && make menuconfig && make install modules_install && emerge gnome mozilla-firefox openoffice && emerge grub && cp /boot/grub/grub.conf.sample /boot/grub/grub.conf && vi /boot/grub/grub.conf && grub && init 6
<@insomnia> that's the first one

Anyway, this continued until my breaking point was reached when I needed to install my new laptop and I did not really have the time to compile everything from source to have a working linux machine, so I opted for the package install. Downloaded all the CDs. Burned them to disk and then started with the package based install. Superb I thought. Not as optimal as it possibly could be, but hey - I have a nice fast laptop now, I will never know the difference. Until it was that for whatever reason - to this day I am still not sure, my installation decided to go and get a newer version of KDE from the web and build it. Bork. Recompile Xorg and a whole lot of other crap that was bound to go on for hours, so I decided enough was enough. Give me a package based distro that works.

It just so happened that someone in the office had a copy there and then of Fedora Core 1. So I installed it with the fear and dread of 'Dependency Hell'. I suppose with expecting the worst and then things actually working - updates package installation, maybe my assessment of the OS was over exaggerated, but I was impressed. Since FC1, I have used hundreds of machines running RHEL2.1, 3, 4 & 5 - as well as most Fedora Core releases on desktop/home machines (except 2 and 4 which were shit) and I honestly have only ran into issues with dependencies out of my own stupid fault.

I can say though, that I am not impressed by the whole MP3 patent issue which makes RH/Fedora so anal retentive. As a result has led to the spin off of repo providers of a handful of applications that are not in the base distro. I have had to learn which repos to trust in terms of being well maintained and also had to learn (the hard way) that they are often not aware of each other, often competing with each other in the providing of packages for FC. This I feel is bad for the end user in terms of providing an easy, elegant solution / offering. It is possible that it is off putting and would lead them to maybe look at another distro or OS.

I am also not impressed that the release cycle of Fedora is about on a par of that of the reproductive time cycle of a rabbit. Popping out new FC's every time I seem to have just got around to re-installing my machine with the last release. It is for this reason that I am currently using Mandriva, which seems to have a sensible release cycle as well as the ability to upgrade. Good for now, but I will also be giving FC10 a spin when it is finally released.

I have used RHEL in the enterprise for all manner of uses - from the critical to the trivial - and I have found that if you use the OS correctly, you will be faced with no problems using RPM to manage packages. And I have no doubt that the same can be said about dpkg or any other package management utilities. And that is the important factor here. It is how you manage the OS which will ultimately depend on how well it will work. If you want to break the package management - as with any other part of the OS, then this can be done with relative ease, but understand that it is most likely the fault of the Admin and not RPM.

Over the years in our environment we have stood by the rule that if the package is not provided by the OS, then we package the application ourself and maintain the package from our own repository. We have built up a repository for RHEL of over hundreds of packages now, it may even have passed the 1000 mark. It has stood us well up until now, and not one of our admins have ever complained of 'dependency hell'.

I have seen recent conversations which have attributed almost everything to being the fault of RPM. Even to the point where I wonder that if Apophis does smack into the earth on 2029 or 2036, RPM will be blamed for that as well? My point is that a good system administrator should not be falling down those types of pitfalls in the first place no matter what package management software they chose to use.

When is Virtualization Beneficial?

There have been many discussions surrounding the various different virtualization technologies and the merits and downfalls of them. Virtualization is not new, we all know that, but every now and again it turns up in the top 3 list of IT buzz words and then silently fades away. To get an understanding as to how important Redhat thought it was two years ago, they delayed the launch of RHEL5 by some number of months so that they could have an 'Enterprise Virtualization' offering. Just out of my own curiosity, I would love to know what the adoption rate of virtualization on RHEL5 platforms are - My guess is that it would not even 10-15% of Redhat's total RHEL5 subscriptions.

There have been many discussions surrounding the various different virtualization technologies and the merits and downfalls of them. Virtualization is not new, we all know that, but every now and again it turns up in the top 3 list of IT buzz words and then silently fades away. To get an understanding as to how important Redhat thought it was two years ago, they delayed the launch of RHEL5 by some number of months so that they could have an 'Enterprise Virtualization' offering. Just out of my own curiosity, I would love to know what the adoption rate of virtualization on RHEL5 platforms are - My guess is that it would not even 10-15% of Redhat's total RHEL5 subscriptions.

So why do people get all excited and foamy at the mouth over virtual machines? I could be wrong here but I am guessing that the majority of virtualization adoption would be to provide an extra machine that does not require too much resources to run a particular OS or service. The primary example is running a windows guest OS on a linux machine. This is usually done when the adopter requires a service that can only run on a particular OS.

This is very useful for obvious reasons and provides an excellent and tidy solution to a messy problem - two machines, screens, infrastructure etc ... But where does virtualization fit in in the broader enterprise type environments? Virtualization providers will dedicated millions of pixels to tell you about how virtualization is the way forward and that it will save money and increase up time and provide better efficiency in the datacentre and so on and so forth. To an extent, this is very true. The capabilities of the tools from say, VMware, can provide are phenomenal. To give a brief indication, the vmotion technology and data centre manager from VMware allows complete automation of the migration of a virtual guest from one physical server to another and then power down the machine that no longer needs to be on. And then power the machine backup and move the guest OS back when the need arises dependent on configured factors such as increase in load. It is easy to see how, in large scale environments, this technology like this can be beneficial.

Unfortunately, there are two factors in the above scenario which can put the dampers on it a little bit. First, proprietary virtualization technology providers 's data centre and virtualization management tools are usually very costly almost to the point where the savings gained from efficient management of the data center or hardware resources are lost when offset against the cost of the technology in the first place. Secondly, the management of such architectures which are not greenfields setup can be tricky and potentially risky to business. And it is for these two reasons that I personally have not been a full adopter of virtualization. I have found myself more often than not falling into the category of the user who needs an extra box and finds the convenience of 'xm create windoz3'

However, a project that I have been working on lately has changed my view on virtualization significantly - to the point that I believe EVERYTHING must be virtualized. The conundrum that was faced was a requirement for 4 HA clusters - oh and also that there was no money for fancy virtualization software. In traditional setups, this would necessitate 8 servers - a luxury that was not afforded to us. So the idea was to implement 5 physical servers and run 8 virtual machines - two on each physical host and one physical servers sitting twiddling it's thumbs until something goes wrong.

The strategy was to use a clustered file system for the 5 physical machines and have the image of the guests reside on the GFS. That way migrating a guest from one physical machine to another was made significantly simpler. This also reduced our infrastructure requirements in terms of switchports, rackspace, power and actual hardware. We believe operating our clusters this way has improved our efficiency from 50% to 80%, purely in terms of hardware required. This example only starts to show what can be done with virtualization. By adding more physical nodes to the GFS, it is possible to operate more and more VMs and thus increase the efficiency further.

The above example, for our environment, was best achieved using RHEL, but it matters not with what linux distro is used. The point was that it can be done and it was done using open source software.

Rollback and move

So, as some of you might have seen, the GLUG site has been down recently for a while. For a variety of reasons I decided to move the site to a new host, and it is now hosted at a new site. Also, because of the breakage, I rolled back to a previous DB dump which I knew to be safe, so a few quotes and maybe users from the last 3 weeks might be missing. I am going to try and get those things back online, but no promises.

What is to come in the near future:

  • new theme
  • a few side extras (see the poll)

Also, looking for a logo. If anyone maybe has some options or ideas, you can contact me using the Contact Us link (I myself am not too good a digital artist...)

Greetz JP

(Official) Hello World!

To anyone reading this, welcome to the new Gauteng Linux User Group website.

Long in the planning and creation, a few of us who can regularly be found in the #glug.za channel on freenode have started on creating a new site for GLUG and some other things too, and here is the product of it so far. We might sometimes move a bit slow on some things in the beginning, but we're moving nonetheless. We've got some ideas for things we want to do, and some we're already busy with.

So stick around if you're interested! To end, many of us who started with this can be found in #glug.za (on freenode)

Greetings JP aka frozty_sa

Site update

Site has now been moved to hosting on an international server (previously run on my iBurst connection at home). Domain update status: the wonderful people we know as IS (or more specifically, the people from org.za, which is a part of IS) has lost the transfer request and I am going to re-submit one shortly (later today, probably) Oh, and due to running on this server mailing is also now fixed! Yay! (just a happy afternote)

frozty out

Syndicate content