Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Wednesday, January 2, 2013

Lvextend to the rescue. - Increasing the size of Root partition in Linux Filesystems.

I'm a linux newbie. I've been playing with it for about a year and a half now and I still see myself a novice user. Probably because I'm not a proper computer science student or may be I wasn't good enough with linux filesystems. Yeah, these things are such a pain in the ass. I agree. Root, Swap, /Boot, Logical volume, physical volume, ext4, lvm, sda, partition, bla-bla-bla, bla-bla-bla... "Oh my God! Spare me the linux mumbo jumbo. I just wanted to be an average user. I didn't want my linux experience to suck bad! Especially with drives and partitions. Grant me this wish, please..." I begged. "What is it son?", asked the Almighty.
"My linux root partition (the partition represented by "/") is running out of space. What do I do? I'm not good with partition manager or the command lines, for I know nothing." God replied, "Here's how..."
First understand what Logical Volume and a Physical volume is. Physical volume is the physical, abstract partition that exists. It is hard coded. That is how the disk drives and the drive partitions in it exists. Logical partitions doesn't exist as a single entity altogether for you to find and point at. They are made out of groups of physical volumes. I'd rather suggest you to refer to the diagram at the LVM Wikipedia page for more information.
Well, here's the real problem. You have installed your linux operating system in your PC by some means. Either using conventional installer mechanism, like Anaconda in Fedora or RedHat supported OSes or like me, with "Install inside Windows" as in Ubuntu. :P
Whatever it is, let's assume for the sake of this article or for real that you had messed up with the partition sizes and now you notice that the size of your root is annoyingly small. Annoying because of the pop-ups that come up, as and when you start to meddle something in it or when you boot your PC up. Goal is to increase any of the size of root, obviously. But, you want your other files to be intact and your existing Windows-Linux dual boot to be undisturbed or rather to put it precisely, everything to be the same except that you want your root size to be increased. "No way!." would tell the old me. "Bitch please... Get me your computer.", I shall tell now.
I'm taking that the linux OS you run shall work in legacy grub or the old grub, to be clear to all(E.g. Fedora 15, 16). Because, that's where you'd find a /boot partition as against grub2 where you wouldn't find one like that. Not an issue. All that really matters is to identify the root partition and increase the size, which I'm sure you can recognize as to what it is. That is, to find if it is /dev/sda9 or /dev/sda10 or whatever it is. And also, we're considering that the file system of the root partition to be lvm2 pv. (linux volume management).

Now, first step: Shut down your computer and make a bootable device with a linux OS. Preferably Fedora, because that's what I'm going to be using throughout and I guess it'll be easy for you to follow. If not, not a problem. Just make sure you install the packages using command line or through GUI.

Step 2: Boot from bootable device and install "Gparted." GUI partition manager for linux in the Live OS.
su -c 'yum install gparted'
snapshot1
Step 3: Run it as adminstrator, find a suitable drive and create a partition out of it, as unallocated space. The space you take out of the original drive is purely your wish. You may take out 5GB or 10GB and all that is left to you. If you can allocate an entire drive to increase the size of root, then fine. Else, follow this way.
Step 4: Right click the unallocated space and make a partition, preferably the same format as that of the lvm2 pv. (ext3 or ext4) After you format, let's assume the new device formed under sda to be /dev/sda10. Replace the sda10 with whatever you get, like if it is sda5, you take it to be /dev/sda5. Right?
snapshot2
Step 5: You can't simply extend this new volume to the root. That is because Gparted doesn't work with LVMs. You'll have to go the command line way.
Type,
"pvcreate /dev/sda10"
Step 6: Type
vgextent <volumegroupname> /dev/sda10
How do you find your volumegroup name ? Type
vgdisplay
and the VG name in it, specifies the Volume Group Name which in my case was vg_laptop.
So the command would be,
vgextent vg_laptop /dev/sda10
snapshot3
Step 7: Next is to find the number of extents. You can achieve this either using command
vgdisplay -v
as like "vgdisplay -v vg_laptop" where the Free PE value gives the number of extents.
Alternatively, you can use, vgdisplay command, that again displays the Free PE value.
Here, I found my Free PE value to be somewhere around 319. (Don't get confused with the screenshots provided. They have been given just for example purpose and doesn't actually reflect the original values that were executed for implementation.)
Step 8: Type
"lvdisplay"
to find the Logical Volume Path.
Which in this case was found to be: LV Path: /dev/vg_laptop/lv_swap
Step 9: Type
lvextend -l +<number-of-free-extents-found-in-step7> <logical-volume-path>
e.g., lvextend -l +319 /dev/vg_laptop/lv_swap
Step 10:
resize2fs /dev/vg_laptop/lv_swap
Voila ! Your root size has just been increased.
Sources :

http://serverfault.com/questions/297631/extend-volume-group-with-adjacent-unallocated-space
http://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/nofreeext.html

Thursday, November 24, 2011

Let Linux breathe some ‘Air’

Oye ! We’re not talking about, atmosphere. Rather about, the Adobe’s Cross platform application runtime environment – the ‘Air’. Yes, just like any other Adobe product, Air is very dynamic, interactive and easy to deploy.

Adobe Air is a means to create Rich Internet Applications – RIA as how Adobe wishes to call it. If the term Cross-platform application runtime environment is a little confusing, take it to be, Adobe Air is a means to create application that utilize all the best components of both Web-based and Desktop computing to bring rich interaction and utility to the app for the user. Of late, a lot of applications are being built in Web based environment. Some of them over Flash, while some with Flex. Deploying these applications across all other platforms, Desktop (Windows, Linux and Mac ) and Mobile ( iOS, Android, Blackberry and Windows Phone 7 ) has always been an issue to be addressed. With so many platforms and application environments, it is not easy at all, to create a run-time architecture that works in sync with all. Adobe Air is meant to eliminate that.

Many Corporate Giants have started shifting towards Adobe Air now. Adobe themselves are using it for employee directory. NASDAQ, Salesforce.com, Model Metrics are some of them using it currently. eBay also uses Air to deploy its Online Auction Application in Desktop environment.

With Air seeing development at such a fast pace, it is so disheartening to see that, Adobe has stopped development for Air in Linux. Why ? ‘Our priorities are currently towards developing the Mobile platform and the action isn’t currently in Linux.’, says adobe’s blog post. It has been over five months, since this happened. But, it was only recently that I noticed it. I wanted to install Tweetdeck, the One-for-all desktop Social Networking App, that uses Air in my 64 bit Fedora 16 Desktop. Though, Open Source Applications are great, there can never be a match to this freeware Tweetdeck. It’s convenient, easy to setup and you got so many tweaks and options to customize. But, there wasn’t any installation package or repository to do it. I desperately wanted to install Adobe Air over my Linux desktop and had finally done it.

Here’s how to do it.

Installing Adobe Air in Linux

For 32 bit

 

  • Go to, Adobe Air download page, you’ll be prompted to choose the old repository. Download the Adobe air v2.6 binary file (.bin)
  • Open your terminal.
  • Navigate to the location where you’ve your binary file.
  • Make it executable by running the following command

     chmod +x <name-of-your-adobe-air-installtion-file>.bin

  • Run the file with the command
           ./<name-of-your-adobe-air-installtion-file>.bin

You’re done. You’ll have installed your application. But, would not receive any more updates. If in future, some application requires a new version of Air to run that, you wouldn’t be able to run it for sure.

For 64 bit

 

  • Running Air in 64 bit computers is one heck of a job. You’ll need 32 bit libraries to do that.
  • So, first, we install 32 bit libraries first. We’ll see the case of Fedora Linux.
  • Open the terminal.
  • Import the keys first.

 sudo rpm --import http://commondatastorage.googleapis.com/xenodecdn/RPM-GPG-KEY-rpmfusion-free-fedora-15

sudo rpm --import http://commondatastorage.googleapis.com/xenodecdn/RPM-GPG-KEY-rpmfusion-nonfree-fedora-15

  • Install RPM Fusion

su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'

  • Install Adobe Air Dependencies

su -c 'yum -y install ld-linux.so.2 gtk2-devel.i686 libdbus-glib-1.so.2 libhal.so.1 rpm-devel.i686 libXt.so.6 gnome-keyring-devel.i686 libDCOP.so.4 libxml2-devel.i686 nss-devel.i686 libxslt.i686 xterm rpm-build'

  • If suppose, you get errors like, Adobe AIR could not be installed. Install either Gnome Keyring or KDE KWallet before installing Adobe AIR,

Run the following command

yum install libgnome-keyring.i686

  • Make it executable by running the following command

    chmod +x <name-of-your-adobe-air-installtion-file>.bin

  • Run the file with the command
    ./<name-of-your-adobe-air-installtion-file>.bin

Done. Great. You’ll run your Air applications now in Linux. Download your air applications and now, you’ll be able to run it with just a click ! Smile