Wednesday, 16 January 2013

Mounting a disk image, and opening an iso image, on Fedora 17

Whilst flailing around on the web, I found a couple of useful bits for mounting a disk image that contains a partition table (for example, a USB isntall image)

Firstly set up a loopback:

 losetup /dev/loop1 install.img

Then use kpartx to setup up the partitions under /dev/mapper

 kpartx -av /dev/loop1

Now the partitions can be mounted

 mount /dev/mapper/loop1p2 /mnt

As a secondary issue, opening an iso from Fedora isd easy, as long as you have the right bits installed. Under Xfce, I installed file-roller and genisoimage to open iso images.

Friday, 11 January 2013

Making libvirt shutdown guests on host poweroff

From Ask Fedora

Set the following in /etc/init.d/libvirt-guests...

ON_SHUTDOWN=shutdown
SHUTDOWN_TIMEOUT=300

Note that this is still valid in systemd at the moment (F17) as the systemd service just calls the sysv init file