Friday, December 4, 2009

Expand that File System

The other day I received several 1 TB disks to add to an existing Dell MD1000. The user purchased the drives to expand a single file system on their RHEL4 server.

I figured I'd share the notes from the expansion in case they might prove useful to someone.

The existing layout:
  • Server running RHEL4 x86_64
  • MD1000 storage currently configured with several 1 TB drives allocated to a single virtual RAID 5 disk with a single hot spare
  • The storage is treated as a block device (not partitioned via fdisk) as /dev/sdb
  • The device is the sole member of a volume group and is entirely allocated to a single logical volume
  • The lvm is formatted using ext3
The task:
  • Physically add the new drives to the MD1000
  • Assign the drives to the virtual disk and change the RAID from 5 to 6
  • Resize the physical volume (pvresize)
  • Extend the logical volume to use all of the additional extents (lvextend)
  • Grow the file system to use the additional space
Backup all of the data, just in case!

Physically adding the disks can be done with the system online, just insert the caddies and allow a few minutes for the drives to be identified by the RAID controller.

Once the drives are installed restart Dell OpenManage (the server is a Dell, so we will use OpenManage to manage the RAID array) on the server so that it identifies the new hardware.

$ sudo srvadmin-services.sh restart
Log into the OpenManage web page (https://:1311/) and navigate to Storage -> PERC 6/E -> Virtual Disks

Select 'Reconfigure' from the drop down box next to the virtual disk that will be expanded. On the next screens, select all of the drives to add to the virtual disk and change the RAID level from 5 to 6. Once complete, the array will begin rebuilding. This will probably take several days to complete.

Once complete, I had to reboot the server before it would see the additional capacity.

Now for the Linux specific steps.
  1. The file system has to be unmounted. In my case, the partition is used to store user data and is not needed for the system to function. Thus it can be safely unmounted with the system in runlevel 3. If we were performing this on the root partition or other system partition, you'd need to boot to the rescue mode using the install media.
  2. # umount /data
  3. Display the current size of the physical volume
  4. # pvdisplay /dev/sdb | grep PE

    PE Size (KByte) 4096
    Total PE 1191679
    Free PE 0
    Allocated PE 1191679
  5. Resize the physical volume
  6. # pvresize -v -d /dev/sdb

    Using physical volume(s) on command line
    Archiving volume group "vg_md1000" metadata (seqno 2).
    Resizing physical volume /dev/sdb from 1191679 to 2860031 extents.
    Resizing volume "/dev/sdb" to 23429381760 sectors.
    Updating physical volume "/dev/sdb"
    Creating volume group backup "/etc/lvm/backup/vg_md1000" (seqno 3).
    Physical volume "/dev/sdb" changed
    1 physical volume(s) resized / 0 physical volume(s) not resized
  7. Running pvdisplay again will show the new free extents
  8. # pvdisplay /dev/sdb |grep PE

    PE Size (KByte) 4096
    Total PE 2860031
    Free PE 1668352
    Allocated PE 1191679
  9. Now extend the logical volume by the number of free extents
  10. # lvextend -l +1668352 /dev/vg_md1000/lv_data

    Extending logical volume lv_data to 10.91 TB
    Logical volume lv_data successfully resized
  11. The lvdisplay command will confirm that that the logical volume is now expanded
  12. # lvdisplay /dev/vg_md1000/lv_data
    --- Logical volume ---
    LV Name /dev/vg_md1000/lv_data
    VG Name vg_md1000
    LV UUID xxxxxxxxxxxxxxxxxx
    LV Write Access read/write
    LV Status available
    # open 1
    LV Size 10.91 TB
    Current LE 2860031
    Segments 1
    Allocation inherit
    Read ahead sectors 0
    Block device 253:0
  13. Running a file system check isn't such a back idea (this will take a long time to complete on a multi TB file system)
  14. # e2fsck -f /dev/vg_md1000/lv_data

    e2fsck 1.35 (28-Feb-2004)
    Pass 1: Checking inodes, blocks, and sizes
    Pass 2: Checking directory structure
    Pass 3: Checking directory connectivity
    Pass 4: Checking reference counts
    Pass 5: Checking group summary information
    /dev/vg_md1000/lv_data: 827839/610140160 files (2.4% non-contiguous), 1060122031/1220279296 blocks

  15. Grow the file system (ext3)
  16. # ext2online /dev/vg_md1000/lv_data
  17. Mount it and let the users know they can begin to fill it up (that's their purpose in life, isn't it?)

Tuesday, November 24, 2009

How To Encrypt Home on Fedora

Encrypt Your Linux Home Partition

This how to explains the process of encrypting a partition on an existing system.

If you are installing a new Linux box, or reinstalling, the graphical installation for RHEL5.4 and later, Fedora, Ubuntu, OpenSuSE now all provide easy GUI tools to accomplish this.

Doing so on an existing system takes a bit of care so as not to destroy data.

The following are notes that I took while running through the process for the first time. Some steps may be redundant or unnecessary, if so, feel free to add comments and I'll adjust the process.

  1. Identify the partition that should be encrypted. In this example, I'm going to encrypt the partition (/dev/sdb1) that is mounted as /home
  2. Backup the data before proceeding. The process of encrypting requires a format, since this is /home, it makes sense to log out of the desktop, log in as root to the terminal (CTRL ALT F2) and 'init 3'. The /home directory can be safely unmounted
    # init 3
    # mkdir -p /backup/$(hostname -s)
    # rsync -a /home /backup/$(hostname -s)
    # umount /home

  3. Use cryptsetup to initialize the LUKS partition (again, make sure it is umounted) and set the initial key / passphrase. Use whatever good passphrase you want to unlock this device in the future. If necessary, additional keys can be added for multi user support.
    # cryptsetup luksFormat /dev/sdb1
  4. Identify the UUID of the partition
    # blkid /dev/sdb1

    /dev/sdb1: UUID="186f67df-9872-44d5-947c-a010d831f570" TYPE="crypto_LUKS"
  5. Open the LUKS partition setting up a mapping named based on the UUID (this is the default naming convention used by the Fedora installer)
    # cryptsetup luksOpen /dev/sdb1 luks-186f67df-9872-44d5-947c-a010d831f570
  6. Format the device, I'll use ext4 since it's the new standard on Fedora and Ubuntu
    # mkfs.ext4 /dev/mapper/luks-186f67df-9872-44d5-947c-a010d831f570
  7. Once again, verify the UUID for the device, if you don't get this correct, the system will hang at bootup as it attempts to mount the device
    # blkid /dev/sdb1

    /dev/sdb1: UUID="186f67df-9872-44d5-947c-a010d831f570" TYPE="crypto_LUKS"
  8. Add the device to crypttab to map it to the correct UUID
    # vi /etc/crypttab

    luks-186f67df-9872-44d5-947c-a010d831f570 UUID=186f67df-9872-44d5-947c-a010d831f570 none
  9. Add the new mount to /etc/fstab so that it mounts at boot (make sure to comment or remove the existing /home entry). If you choose to automount encrypted partitions the boot process will pause prompting for the passphrase. This may be undesireable, especially in the case of a server where you might choose to mount manually following boot!
    # vi /etc/fstab

    /dev/mapper/luks-186f67df-9872-44d5-947c-a010d831f570 /home ext4 defaults 1 2
  10. Before you reboot, make sure to locate a copy of the installation media just in case you need to enter recovery mode (most likely due to a typo in fstab or crypttab)
    # /sbin/shutdown -r now
  11. During the boot process you'll be prompted to enter a passphrase to unlock the partition.
  12. If you need multiple keys (maybe this is a shared workstation or laptop), you can add new keys as follows
    # cryptsetup luksAddKey /dev/sdb1

Chromium on Fedora 12

Update: Google now has an official repo for Linux that work for Fedora 12 and 13

20100917 - Updated the contents of this post to replace 'beta' package references to 'stable'.

Create the Google yum repository configuration file (replace x86_64 with i386 in the repo file to use the 32bit Google repository)
$ sudo vim /etc/yum.repos.d/google-chrome.repo

[google]
name=google - x86_64
baseurl=http://dl.google.com/linux/rpm/stable/x86_64
enabled=1
gpgcheck=1
gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub


Then install Google Chrome
$ sudo yum install google-chrome-stable

====================================================================================================================================
Package                                    Arch                          Version                                      Repository   
====================================================================================================================================
Installing:
google-chrome-stable                       x86_64                        5.0.307.11-39572                             google-chrome
Installing for dependencies:
cvs                                        x86_64                        1.11.23-8.fc12                               fedora       
foomatic                                   x86_64                        4.0.3-8.fc12                                 updates      
foomatic-db                                noarch                        4.0-8.20091126.fc12                          updates      
gettext                                    x86_64                        0.17-16.fc12                                 updates      
libmodplug                                 x86_64                        1:0.8.7-2.fc12                               fedora       
libmpcdec                                  x86_64                        1.2.6-6.fc12                                 fedora       
patch                                      x86_64                        2.6.1-1.fc12                                 updates      
pax                                        x86_64                        3.4-10.fc12                                  fedora       
phonon                                     x86_64                        4.3.80-5.fc12                                updates      
phonon-backend-xine                        x86_64                        4.3.80-5.fc12                                updates      
qt                                         x86_64                        1:4.6.2-3.fc12                               updates      
qt-sqlite                                  x86_64                        1:4.6.2-3.fc12                               updates      
qt-x11                                     x86_64                        1:4.6.2-3.fc12                               updates      
qt3                                        x86_64                        3.3.8b-28.fc12                               fedora       
redhat-lsb                                 x86_64                        3.2-7.fc12                                   fedora       
xine-lib                                   x86_64                        1.1.16.3-5.fc12                              updates


Original content:
Want to run Google Chrome web browser on your Fedora workstation? Not exactly Chrome, but you can install and run the open source browser (devoid of Google branding), Chromium, of which Google Chrome is based.

Chromium will install on both 32bit and 64bit systems.

First, create a new yum repository configuration file (/etc/yum.repos.d/chromium.repo):
[chromium]
name=Chromium Test Packages
baseurl=http://spot.fedorapeople.org/chromium/F$releasever/
enabled=1
gpgcheck=0
Next install chromium, 2 packages will come from the chromium repo, chromium and v8:
$ sudo yum install chromium

Dependencies Resolved

==============================================================================
Package      Arch      Version                            Repository     Size
==============================================================================
Installing:
chromium    x86_64  4.0.252.0-0.1.20091119svn32498.fc12   chromium      9.7 M
Installing for dependencies:
minizip     x86_64  1.2.3-23.fc12                         fedora         24 k
nss-mdns    x86_64  0.10-8.fc12                           fedora         21 k
v8          x86_64  2.0.0-1.20091118svn3334.fc12          chromium      810 k

Once installed, you'll find Chromium on the Applications menu under Internet.

v8 is Google's open source JavaScript engine.

Tuesday, October 27, 2009

Major NFSv4 issue with CentOS 5.4 / RHEL 5.4

I updated my NFS server yesterday to EL5.4 (kernel 2.6.18-164.el5) as well as the client workstations. The clients mount /home via NFSv4.

Shortly there after my users began reporting odd behavior like "Firefox bookmarks won't load".

I decided to test it remotely and encountered a file locking problem with .Xauthority:

$ ssh -X wkstation01
/usr/bin/xauth: error in locking authority file /home/flakrat/.Xauthority

After much digging, an IRC user in #RHEL pointed me to the following bug:
https://bugzilla.redhat.com/show_bug.cgi?id=524520

Three immediate solutions:
  • Reboot to the previous 2.6.18-128.7.1.el5 kernel until the new kernel is released
  • Download the patches in the bug and rebuild the kernel
  • Get RH support to send you the interim patched kernel

Wednesday, September 9, 2009

Looking for a Replacement for Notepad++ on Linux? Try Geany!

There are many nice text editors / IDEs out there for Windows, Linux, and Mac. On the Windows front, one of the best (IMHO) is Notepad++.

Unfortunately, NP++ is not available for Linux. Sure you can get it working via WINE, but I'd rather have something that provides similar features that just works in Linux. Notepad++ uses Scintilla as it's core editing component.

Luckily, there are several IDEs for Linux that use Scintilla, so the features and feel of Notepad++ are not lost to the Linux world.

Geany is the editor that I've been using lately (along with vi/vim). Currently at version 0.18, Geany has a long list of features and supports many of the common scripting and programming languages. One of the primary goals of the development was to limit dependencies, thus Geany only requires the GTK2 runtime libraries and is agnostic to the desktop (Gnome, KDE, etc...).

Here are some of the features listed on the website:
  • Syntax highlighting
  • Code folding
  • Symbol name auto-completion
  • Construct completion/snippets
  • Auto-closing of XML and HTML tags
  • Call tips
  • Many supported filetypes including C, Java, PHP, HTML, Python, Perl, Pascal (full list)
  • Symbol lists
  • Code navigation
  • Build system to compile and execute your code
  • Simple project management
  • Plugin interface (see Plugins)
Up to now, I've been using KDevelop (in Gnome :-) as my IDE. It's a nice editor, but a little clunky for my scripting needs. So far, I'm very impressed with Geany.

If you are running Fedora, Geany and various plugins can be installed using the following Yum command:
$ sudo yum install geany geany-plugins-*

If you'd like to stick to Gedit, you can pimp it out using this guide. The advantage here, Gedit is available on most distributions right out of the box (assuming a graphical install).

iPhone OS 3.1 and iTunes 9 Released Today

The Apple website has announced that iTunes 9.0 and iPhone OS 3.1 have been released. Apple also has information related to their new line of iPods.

The new iTunes has a nifty feature that lets you organize your apps from within iTunes (rather than on the device itself).

See this InformationWeek article for more details.

The feature I'm eagerly anticipating, the ability to skip song tracks using the controls on my Motorola S9 stereo bluetooth head set. OS 3.0 introduced stereo bluetooth to the iPhone, but for some reason did not include the ability to skip forward / back song tracks.

iTunes 9.0 is ready to download now, the OS update is supposed to be out today (Wed) but it's not yet shown up in iTunes.

Friday, July 24, 2009

iPhone 3.1 OS Update to Include BlueTooth Control Support

According to The iPhone Blog the upcoming release of iPhone 3.1 OS includes support for using the next/prev track controls on Blue Tooth head sets.

iPhone OS 3.0 introduced support for stereo BT head sets including partial support for the controls (volume and play/pause), but curiously no support for skipping tracks. 3.1 will remedy that thankfully.

There are other features and improvements in 3.1, for example, you will be able to paste into the phones keypad screen (automatically transposing alpha-numerics phone numbers into digits) and some updates to 3GS specific functionality.

Unfortunately, there isn't any mention yet whether Apple has identified the root causes of 3.0's battery consumption and heat issues.

3.1 beta 2 released this week, expect several more betas before the final product is released.

Thursday, July 16, 2009

VMware Releases ESXi with Dell / IBM Customizations

The VMware ESXi download page has two new downloads, ESXi installable with Dell and IBM customizaions:

VMware ESXi 4.0 with Dell Customization
Version 4.0.0 | 164009 - 07/16/09 348 MB ISO Image for ESXi Installable that includes Dell customization.

VMware ESXi 4.0 with IBM Customization
Version 4.0.0 | 164009 - 07/16/09 348 MB ISO Image for ESXi 4.0 Installable that includes IBM customization for use on supported IBM server platforms.

I can't find any information detailing what 'customization' is included in either install. Is it management (OpenManage stand alone), drivers???

I suppose I'll have to install it on one of the m600 servers and find out.

Update: I got a response from a Dell rep on the Power Edge mailing list "Vmware ESXi 4.0 includes Dell OpenManage as well apart from drivers."

Friday, June 26, 2009

Windows 7 Pre-Order Starts Today, Half Off

Microsoft has made it official, click here for details.

There are a good number of retailers selling the pre-order (the standard set, Best Buy, Office Depot...), and online you can get it at Newegg.com, Amazon and Tiger Direct.

Microsoft has this note about the duration of the pre-order sale: "The offer begins on June 26, 2009 and will continue while supplies last, or until July 11, 2009, whichever comes first."

This is probably the best deal you could expect out of Microsoft. So pre-order while you can.

Thursday, June 25, 2009

Windows 7 Discount, Limited Time Only!

According to this article at CNN (which appears to originate from CNET), Microsoft is discounting the heck out of Windows 7 Home and Professional upgrades for a period of two weeks.

Starting tomorrow (June 26) thru July 11, you will be able to purchase the upgrade versions on Windows 7 Home and Professional for $40 and $99 respectively.

Those of us who are running the release candidate need to jump on this offer. Unfortunately, I haven't found any word of a discount on Windows 7 Ultimate, so those running the RC may be forced to reinstall to downgrade from Ultimate to Professional.

The upgrades should be available at Best Buy, Amazon and many other retailers. I checked Newegg.com but as of today, all they list is the release candidate.

The article also mentions something about limited quantities. They weren't able to expound on that, so who knows what that means. Limited number of copies per customer, or a limited number for the entire community?

Wednesday, June 10, 2009

Fedora 11 Released

Fedora 11 Leonidas released yesterday. I've performed an upgrade and a clean install, both on encrypted laptops. Both installs went smoothly, however the upgrade took close to 3 hours. Yikes!

Some thoughts:
  • ATI has not released fglrx drivers yet for kernel 2.6.29, on which is what F11 is based
  • To get my nVidia based card (Geforce 8400 GS) to boot using the fancy Plymouth animated scene, I had to add "vga=0x361" to the kernel boot params in grub.conf, 32 bit 1280x800
  • I also had to add "vmalloc=128MB" to my grub conf so that the nvidia (kmod-nvidia-PAE) would load at runlevel 5. I kept getting errors related to vmalloc without this. Obviously, if you had a 256MB card you'd want to set it appropriately
I've just finished the installs / upgrades, so I can't comment yet on the features.

Get Fedora 11 now at fedoraproject.org

Update: The issue that I encountered with my nVidia card in F11 is documented in this Red Hat bug: https://bugzilla.redhat.com/show_bug.cgi?id=489078

I also made an FAQ entry documenting this solution on the Common F11 Bugs page.

Wednesday, June 3, 2009

Windows 7 Release Date Set

Microsoft has announced that Windows 7 will release October 22, 2009.

I've been running Windows 7 RC 64bit on one of my home systems and have been pleased with the speed and stability as compared to Vista.

Friday, May 29, 2009

Fedora 11 Delayed until June 9

Unfortunately, the release of Fedora 11 has been delayed by just over a week due to this bug.

In a nutshell a scenario was uncovered by which anaconda would attempt to remove an extended partition while it still contained logical partitions.

Good find and definitely worth pushing the release back to address.

Wednesday, May 20, 2009

HalfLife 2 error



It's always nice when developers spell out exactly what happened.

Now if they'd only provide their cell phone digits so I could contact said programmer.

Wednesday, May 6, 2009

Windows 7 RC1

If you haven't downloaded it already, do so. Windows 7 RC1 is free and comes with a key that expires in July 2010. I don't recall Microsoft ever being that generous with a release candidate. The download should be available into June of this year.

I downloaded and installed Windows 7 RC1 and installed the x86_64 version (clean install) on my Windows Vista computer. So far, the Windows 7 experience has been worlds better than all my early experiences with Vista.

The install was easy, almost too devoid of options. Apart from the disk partitioning, you really don't get any control over what gets installed. All of my hardware worked right out of the box (AMD Phenom 9550 Agena quad core, ASUS M3A-H/HDMI motherboard and XFX 9800 GT nVidia video).

I have dual monitors, a 22" wide screen 1680x1050 LCD and a 19" 1280x1024 LCD and both were detected properly, set to the correct resolution and, get this, "Extended Desktop" was enabled by default. Wow, this is the first time I've had an OS install and not use mirrored desktop as the default.

Following the install, I ran Windows Update and, in addition to the OS updates, I allowed it to install all of the driver updates. In the past I have never had good luck using driver updates from Windows Update. Either they flat out did not work, or they were so out dated that it was laughable.

In this case, WU actually had the latest bleeding edge nVidia driver that adds support for some of the new desktop features of Windows 7. Those installed and work great (even included nVidia control panel).

The bad news, the ethernet driver "Atheros L1 Gigabit Ethernet" installed and promptly failed to link up with my router. A few reboots later and I still couldn't get it working. I used the "Roll Back Driver" button in Device Manager, taking the driver back to 2.4.7.17, and the card began working immediately.

One application that I see getting a lot of use is the "Resource Monitor" that can be launched from the Task Manager window. It shows you process information from four different view points; CPU, Memory, Disk and Network. Granted, most, if not all, of this information can be viewed using other tools, but this tool puts it all in a single GUI. I don't know if Mark Russinovich had a hand in developing the tool, but it certainly looks like a Sysinternals type tool.

Under My Computer -> Network, I can browse my DirecTv HR20 HD DVR, unfortunately the connection gets refused. Maybe at some point DTV will open this up and allow us to watch recorded shows on our PCs without having to install their clunky software.

Oh, and Windows 7 RC1 passed the Left 4 Dead test with flying colors :-)

Thursday, April 16, 2009

Using VMware Player to Connect to an ESXi Guest

Did you know that you can connect the VMware Player client to a guest running on VMware ESX/ESXi?

This is handy, especially for Windows guests where you don't want to enable RDP or some other remote desktop service (VNC).

The guest will automatically start if it isn't already running. A drawback (or benefit depending on how you look at it), via VMware Player you don't have the ability to edit hardware configuration or manage snapshots. You'll still need to use the VIC for that.

I was running a Windows guest (via VMware Player) on my Fedora 10 desktop to have access to MS Office, support for corporate Windows only apps, and most importantly access to the Virtual Infrastructure Client. Even with a fairly speedy dual core workstation, the Windows guest consistently bogged down the workstation. So, I decided, why not run this thing on the server and let it handle the load?

I used VMware Converter (free) to convert the VMware Player guest to a Virtual Infrastructure guest and sent it to the datastore on the ESXi server. I didn't realize that VMware Converter could transfer the converted guest on the fly to the ESXi server without purchasing extra licenses, well, it can and does.

Once the guest completed conversion and transfer to the ESXi server, i created a desktop launcher for VMware Player to launch the guest directly. The command line is as follows:

/usr/bin/vmplayer -h 10.1.1.2 -u "flakrat" "[datastore1] winxp01/winxp01.vmx"

Unfortunately, I don't see any method of adding VI guests to the list of "Recent Virtual Machines" in VMware Player client. Thus the custom desktop launcher.

Tuesday, April 14, 2009

The migration from Rocks to xCAT

Thinking of using an alternative HPC solution to Rocks? Check out xCAT.

xCAT appears to be much more flexible, and less entangled with the underlying operating system (in Rocks case, either Red Hat EL5 or CentOS5). This is appealing in that you can apply core OS updates without the worry that you'll break compatibility with the cluster stack.

There's a long history of discussions on the Rocks mailing list about how to apply core OS updates, and which packages to avoid. Over the releases, Rocks has moved much of the functionality into its own space or commands (for example, old Rocks had a modified /usr/sbin/useradd). Some users now claim that they apply updates to the nodes on a weekly basis without any problems, while others say that it's still possible to break components by applying the updates.

xCAT lives in its own space, under $XCATROOT (I think I have that right). Since xCAT is perl based, your biggest exposure would be updating the core perl to a much newer release, but you'd have to do that outside the normal yum repos.

One of Rocks strengths is that a novice Linux user can install and manage a basic cluster fairly easy, and conversley xCAT appears to have a steep learning curve and certainly requires a good deal of familiarity with Linux in a CLI environment (sorry no GUI yet).

More to come as I get time to play with xCAT.