Pages

Monday, May 07, 2012

Managing Partitions in Linux

Managing partitions in Linux is easy with the right tools. Some of the tools readily available on Fedora 16 are
  • Disk Utility
  • GPartEd
  • parted
PartEd is a console application and can be used from a rescue disk. I've managed to detach and move the /boot partition while the system was running.
To work with Logical Volumes, additional package is required:
  • system-config-lvm
This is a GUI tool for managing logical volumes on an extended partition. You can also use the following commands manually:
  • lvresize,  for resizing logical volumes (LV)
  • pvresize, for resizing physical volumes (PV)
For more details, see the LVM How-To. It describes LVM concepts in details. After reading the text it becomes quite clear how LVM system works and puts things into perspective. There is no need to resize a Volume Group as such. It simply contains all the physical disks we assign to it, abstracts all that space into one unit and then splits it up into Logical Volumes. This means that, to increase space in a Logical Volume Group we would simply add another disk or partition to it and then resize the Logical Volumes. To shring the Group, we would shrink the Logical Volumes and then remove the Physical Volume from the Group. 

However, to resize a Group that has only one Physical Volume, is a bit more difficult. How to do this without a reboot is described here. The point, as described here, is to shrink the Logical Volume first, then the Physical Volume. In the end, delete and (re-)create the LVM group with the same starting position. By setting the end position before or after the previous value you would effectively shrink or enlarge the LVM partition.

And, in the end, there is KDE Volume and Partition Manager (link) - kde-partitionmanager - that supports both parted and lvm (lvm2) commands. As the description states: "Kvpm is a GUI front end for Linux LVM and Gnu parted. LVM2 groups and volumes can be created, removed and manipulated using most of the options supported by the standard LVM2 tools. Some support for creating and operating on partitions is also provided. It also handles creating and mounting file systems.

The LVM version: 2.02.88 or newer must be installed with the lvm2app library. Only the KDE 4 libraries need to be installed, not the entire desktop, so it my be run from within Gnome for instance."
It is worth trying out.

References: LVM How-to (link), LVM Cheatsheet (link), Extend a Volume Group (link), Editing Logical Volumes (link), LVM Resizing Guide (link), Growing a live LVM volume (link), Moving LVM partition (link)

Friday, May 04, 2012

Issues with VMWare Workstation and new kernels

After installing the latest kernel package on Fedora 16, VMWare Workstation 8.0.2 stopped working. It requires certain modules to be built into the kernel and there is a script that automatically runs, compiles them, and installs. All this should be pretty straightforward except that it does not work. Module vmnet can not be started after the compilation.

Fortunately, there is a patch available at the link below. I used the one for VMWare 8.0.2. The process is as simple as extracting the files (one shell script and one patch) and running the shell script. It will patch the source and run the compilation again. After this, vmware services still don't start but the Workstation can start.

There is an error accessing ALSA sound while booting a virtual machine. Changing the sound driver to Default (ALSA) makes it work again.

Patch (link)


Update: This has to be re-applied every time kernel is upgraded. However, after installing 3.4.0 it did not work. The solution with kernel 3.4.0 is here. The files are here and, instead of using /usr/lib/vmware, you should go one level lower, to /usr/lib/vmware/modules, extract the package and run
vmware-modconfig --console --install-all

Removing old kernels in Fedora 16

If you find too many kernels being listed during Grub screen on system boot, cleaning up old kernels is extremely easy:

package-cleanup --oldkernels

Automount NTFS partition on startup in Fedora Linux

'blkid' displays the UUIDs of disk partitions.
Then put the UUID into /etc/fstab and set the mount point. The drive with the given UUID will be mounted on system startup.

http://forums.fedoraforum.org/showthread.php?p=1396111

Thursday, May 03, 2012

Gnome Shell Extensions

Here are useful additions to Gnome Shell, like Alternative Status Menu enabling Hibernate option in Shell Status Menu, showing icons in window preview, adding the Applications menu to the status bar, showing system monitor in the panel, etc.

The really convenient thing is how you can see installed extensions on the web site, enable or disable installed extensions, or add new ones simply by clicking the On/Off switch on the web page.

https://extensions.gnome.org/

The ones I like are:
  • Hide Top Bar (link) - the new favourite for Gnome 3.6. Auto-hide top panel.
  • Alternative status menu (link)
  • Advanced settings in user menu (link)
  • Panel settings (link)
  • Window Overlay Icons (link)
  • Net Speed (link)
  • system-monitor (link)
  • Remove Accessibility (link)
  • Remove username (link) - get some space in the panel.
  • Caffeine (link) prevents the shell from going to sleep. Useful when watching movies, for example.
#linux #gnome

Friday, April 27, 2012

Custom User Agent in Chrome

This must be the coolest thing ever. :) There was this very annoying thing with Google Chrome on Linux where Google servers would redirect my request for maps.google.com to the mobile version of the site and then, immediately, to Places instead of Maps. There was just no way to get the map view in the perfectly valid browser.
I analyzed the messages exchanged between the browser and the server and thought the server might be confused by the User Agent setting. Especially because everything worked perfectly fine in Firefox on the same machine. And I could open maps on the Android smartphone being used to relay the connection.
So, Open Source devs to the rescue. There is a command-line option to set the User Agent when starting Chromium-based browsers. It is as simple as running

google-chrome --user-agent="Firefox/3.5.5"

or whatever else you want. More appropriate would, probably, be to use "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/536.6 (KHTML, like Gecko) Chrome/20.0.1092.0 Safari/536.6" as that is the user agent string for one of the later Chrome browsers on Windows.

Nepomuk Desktop Search in Gnome

Dolphin is becoming my tool of choice lately. Nepomuk integration is great. It is replacing my dependency on Google Desktop in Windows.
However, Nepomuk is not running in Gnome by default. There is some other search engine running (which reminds me I should disable it at some point). Fortunately, it is quite easy to get Nepomuk search back. Since I have KDE installed, all that is required is to add nepomukserver to the list of startup applications.

Reference

Windows Key for Applications Menu in xfce

If you want to use Win key to open the Applications menu in xfce, follow the instructions here and, instead of typing "xfce-popup-menu", use "xfce-popup-applicationsmenu".

Thursday, April 26, 2012

64-bit Wine in Fedora 16

I'm not sure how wine was compiled and packaged in Fedora 16 but 64-bit package gave me nothing but trouble. This was the most common issue, popping up as soon as I'd try to create a 32-bit prefix:

wine: WINEARCH set to win32 but '.wine' is a 64-bit installation

After I uninstalled the x86_64 version of wine and installed i686 all the nuisances went away.

Update: See this post for the proper way to create a 32-bit prefix.

Mount ISO files in Linux

Mounting an ISO file in Linux is quite simple. The command looks like:
mount -o loop disk1.iso /mnt/cdrom
It is specifying a loop device and then mounting the listed ISO file under the given mount point, which has to exist prior to issuing the command.

Source: http://www.cyberciti.biz/tips/how-to-mount-iso-image-under-linux.html

Update: In Fedora 18, mounting ISOs is as easy as double-clicking on them in Nautilus (file manager). By default, ISO files will be handled with ISO Image Mounter and mounted to the file system. Then, in Nautilus, you will see the new device under Devices section, showing the contents of the ISO file. Quite handy and simple.