Thursday, February 14. 2008
HP printers and multifunction units are well supported in Fedora, thanks in large measure to HP's decision to open-source its driver software and utilities (hplip) in cooperation with related projects such as sane, ghostscript, and cups. The hplip-gui package provides a simple, convenient GUI front-end to these tools, making it easy to scan and print documents, access photo cards, and control copy and fax functions. hplip-gui also provides access to useful device information such as toner and ink levels.
The HP Device Manager displays a list of available devices and provides a point-and-click interface to the features of each model. External programs such as xsane are leveraged where appropriate, and other capabilities are provided directly by the device manager.
Installing from the command line: yum install hplip-gui
Installing using the graphical installer: not available through the Browse view; use the Search or List views to install hplip-gui
Menu location after installation: System>Administration>HP Device Manager
Upstream website: http://hplip.sourceforge.net/
Wednesday, February 13. 2008
A Fedora system usually begins its boot process with a startup screen (or menu) displayed by the bootloader Grub. The background for this screen is provided by the wonderfully talented Fedora artTeam. The image is in the file /boot/grub/splash.xpm.gz from the package fedora-logos.
Customizing your boot screen with a favorite photo, your company logo, or even a cartoon is quite straightforward:
Reboot to see the result.
The XPM format used by Grub is very unusual: it's actually a snippet of C source code containing an ascii-to-colour translation table and the image encoded as ASCII art. You can see this by using gunzip to decompress the file and then viewing it as text.
Tips on preparing a grub splash image:
Tuesday, February 12. 2008
PDFCube is a tiny (35k) player for PDF presentations. It provides double-buffered page switching (PgUp/PgDown or space), zoom to the corners or center of a page (h,j,k,l,z), and a Compiz-style animated cube transition (c).
Since repeatedly viewing the cube transition on a large projection screen can be dizzying, the program's author recommends using it only for major topic transitions within a presentation. To accomodate this, you can pre-select the transitions which should be performed using the cube animation on the command line:
This example would use the cube effect when transitioning from page 5 to 6 and from page 12 to 13, but use a straight jump transition for the other pages. When PDFCube is invoked in this way you can advance from page to page using the spacebar, and the correct transition will be selected for each page.
Installing from the command line: yum install pdfcube
Monday, February 11. 2008
In the late 1960's, a computer algebra system named Macsyma was developed at MIT. This system was commercialized by Symbolics, and a number of other programs such as the proprietary Maple and Mathematica systems were inspired by it.
Fedora includes the maxima package, an open-source descendant of the original Macsyma code (forked in 1982 and placed under the GPL in 1998). It provides powerful symbolic and numeric manipulation and 2D and 3D plotting capability, and the maxima-gui package provides the simple but functional xmaxima graphical front-end.
(Note: sometimes, an sbcl (Steel Bank Common Lisp) process will continue to run after Maxima has been terminated, consuming a lot of CPU time).
Installing from the command line: yum install maxima-gui
Update: maxima package maintainer Rex Dieter points out that wxMaxima provides a nice alternate graphical front-end to maxima. (Thanks, Rex!)
Friday, December 7. 2007
When performing system recovery, it is sometimes useful to capture the data from a disk drive into an image file which can then be manipulated on another system -- this is useful when hardware failure is imminent. You can copy a disk's contents over the network using a command such as:
The -C option specifies compression, which may or may not be beneficial, depending on the speed of the network connection and the speed of the local and remote CPUs.
This resulting file (disk1.img in this example) is an exact copy of the data on the original disk. The same type of disk image is used for Xen and KVM virtualization.
The file command will report this type of file as an x86 boot sector:
You can view the partition table of the disk image using fdisk -l. However, to access the individual partitions within the image, you must first use losetup to make the image accessible as a block device:
This contents of the disk1.img file are now available through the block device /dev/loop0. (The -f option specifies that the first available /dev/loopN device should be used, and the -v enables verbose mode so that you will be told the name of the block device). You can now use kpartx to create a block device for each partition within the image:
The partition block devices are found in /dev/mapper and are named with the original block device name (loop0) with the letter "p" and the partition number appended. The file -s command will analyze the contents of each partition:
In this example, the first partition contains a filesystem which may be directly mounted (e.g., with mkdir /mnt/x1 ; mount /dev/mapper/loop0p1 /mnt/x1).
The second partition contains swap space, which is probably not of any interest. The third partition contains an LVM physical volume (PV), so you will need to use vgscan and vgchange to gain access to logical volumes contained therein:
Note that in this case the discovered VG name is zephyr. Once these steps have been performed, the zephyr LVs can then be mounted in the usual way to provide access to their contents.
When you are done using the disk image, reverse the procedure to take the disk image out of use:
Thursday, December 6. 2007
When you boot from a Fedora installation disc and enter rescue mode, you have the option of having the filesystems from your Fedora installation mounted at /mnt/sysimage. If you do not select this option, or if it fails, RAID devices will not be configured for use (as is also the case with LVM, as discussed yesterday).
On a Fedora system, RAID arrays are managed by the mdadm utility. This program expects the RAID configuration to be available at /etc/mdadm.conf. In order to use mdadm without this configuration file, it is necessary to create a dummy configuration file. This is a multi-step process:
Wednesday, December 5. 2007
Logical Volume Management (LVM) is a powerful storage system layer which abstracts the logical view of storage from the actual physical layout. It is automatically configured in the default Fedora storage configuration. LVM enables you to grow and shrink volumes, add storage from new devices to existing volumes, and migrate volumes between storage devices, all without taking the system offline. In fact, the system-config-lvm package provides a convenient way to perform all of these operations using a graphical interface.
However, you can't (yet) shrink a filesystem while it is mounted. This isn't a limitation of LVM itself, but of most filesystems, including ext3. To shrink a partition that is always mounted when the system is running -- such as the root filesystem -- it's necessary to boot from another medium, which is where rescue mode comes in (see yesterday's article). It may also be necessary to use rescue mode to recover from some particularly nasty corruption or misconfiguration issues.
To do LVM and filesystem-resizing work within the Fedora rescue mode, boot the rescue mode from disc as usual, but select Skip when the system offers to mount your hard-disk partitions. Unfortunately, this will mean that your volume groups will not be detected or activated, so you will need to do that manually.
The commands normally used for logical volume management such as vgdisplay, pvcreate, and lvreduce are actually symbolic links to a single executable named lvm. These symbolic links are not available in rescue mode, so you must explicitly use the lvm command followed by the operation you wish to perform: if you wish to do a vgscan, for example, enter the command lvm vgscan.
Therefore, to discover and activate all volume groups, you must execute these commands:
You can display information about the logical volumes using lvm lvs (or lvm lvdisplay for a more verbose display):
Note that the LV and VG names are not very descriptive -- which is why it's a good idea to override the default names during system installation. In this case, we know the approximate size of the LV containing the root filesystem, so we can determine that it is LogVol00 in VolGroup00.
Armed with this information, you can now check (fsck) the filesystem, shrink the filesystem within that logical volume, and then shrink the LV. Because of the potential for rounding errors, it's best to shrink the filesystem to a size slightly smaller than the new LV size, resize the LV, and then grow the filesystem to fully fill the LV:
Note that the operations following the first resize2fs do not need to be performed in rescue mode -- you can reboot the system at that point and continue after the system has booted normally. Earlier versions of the Fedora rescue mode may not set up the symbolic link /dev/VolumeGroup/LogicalVolume, so you may need to refer to /dev/mapper/VolumeGroup-LogicalVolume (e.g., use /dev/mapper/VolGroup00-LogVol00 in place of /dev/VolGroup00/LogVol00).
Tuesday, December 4. 2007
When a system is too damaged to permit booting from the hard disk drive, it's necessary to boot from another medium. The Fedora installation discs support a "Rescue mode" in which the system is booted from the CD and the hard disk partitions are optionally mounted for access.
To access this mode, boot from your Fedora install media and select "Rescue installed system" from the boot menu using the arrow keys and Enter or by pressing the R key (if you need to edit the boot options first -- to disable ACPI, for example -- navigate to the Rescue option with the arrow keys and press Tab).
The kerenel will boot from CD and the system will prompt you to select a keyboard style and language from scrollable lists of options. You will then be given the opportunity to enable the network interfaces on the system, either by entering the IP information or by using DHCP.
The system will then present a dialog stating that the rescue environment is about to find and mount the filesystems from your hard disk Fedora installation, and asks if you wish to continue. This is a critical question: if your filesystems are intact and you wish to access the data that is in them, you can select Continue, the default option. If you are concerned about the state of your filesystems and want to ensure that they will not be altered, but still want to access them, select Read-Only. If your filesystems are damaged, you have multiple Fedora installations, or you wish to perform an operation such as reducing the size of the root filesystem, choose Skip. After some additional messages, you will be presented with a root shell prompt.
If you have elected to continue with read/write mounting of your filesystems, all of the files from your Fedora installation should be available under /mnt/sysimage -- so the normal /etc/passwd file will be available at /mnt/sysimage/etc/passwd.
Although regular Fedora commands and utilities are available in rescue mode, most of them will not work because of the altered paths. You can work around this issue by temporarily changing the root directory using the chroot command:
However, you need to be aware that files within the mounted Fedora filesystems will not have been updated during the rescue mode boot process, including /etc/mtab and /var/log/messages. You can compensate for this by some degree by getting the information from other places (such as dmesg for kernel messages and /proc/mounts for mount information).
If you have been forced to use rescue mode because your system's Grub bootloader code has become damaged or has been overwritten by another bootloader, you can reinstall the Grub bootloader in rescue mode:
You can also use rescue mode to set the root password, create alternate superuser accounts, or change or remove a boot password. Whether these are important recovery operations or a type of attack depends only on the context in which they are performed. You can slow down such an attack by configuring the system BIOS to boot only from the hard disk and installing a BIOS password, but that can be reset using a motherboard jumper in most cases. The moral of the story: if you don't have physical security, you don't have system security.
When you are finished using rescue mode, type exit or press Ctrl-D twice. The system will then reboot.
The Fedora Daily Package exists to highlight lesser-known Fedora Linux packages each weekday-- with a special article each Wednesday taking a behind-the-scenes look at some of the configuration options and packaging details that make Fedora tick. For more information, please see the Fedora Daily Package Welcome posting.
To suggest a future Fedora Daily Package, use the Suggest a Package box below.
Suggest a Package
Chris Tyler's Blog
The Presto Card System and the TTC
Monday, January 30. 2017
Running LEAP: Portable 64-Bit ARM Computing
Saturday, September 19. 2015
The OSTEP Applied Research Team
Thursday, July 2. 2015
Connecting a 96boards HiKey to a Breadboard
Saturday, April 11. 2015
Initial Current and Temperatures on the HiKey from 96Boards
Saturday, February 14. 2015
Syndicate This Blog
Original material in the Fedora Daily Package is Copyright ©2006-2008 by Chris Tyler. This material may be distributed under the Creative Commons Attribution-Share Alike 2.5 Canada License or the Open Publication License.