Sunday, November 13, 2011

Boot Fedora 16 Live from partition on hard drive

Also known as a 'poor man's install', I wanted to have a rescue partition on the hard drive, which I can use grub to boot should something go wrong with the regular Fedora install.

Here's how I did it, based on instructions from http://forums.fedoraforum.org/showthread.php?t=191888

Use fdisk to create a FAT32 partition large enough to hold the live distro, in my case /dev/sda8 below
Format it using mkfs or gparted.


Command (m for help): p


Disk /dev/sda: 320.1 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0xaa9baa9b


   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048    24578047    12288000   27  Hidden NTFS WinRE
/dev/sda2   *    24578048    24782847      102400    7  HPFS/NTFS/exFAT
/dev/sda3        24782848   502260399   238738776    7  HPFS/NTFS/exFAT
/dev/sda4       502261760   625142447    61440344    5  Extended
/dev/sda5       502263808   503287807      512000   83  Linux
/dev/sda6       503289856   605689855    51200000   83  Linux
/dev/sda7       605691904   613883903     4096000   82  Linux swap / Solaris
/dev/sda8       613885952   625141759     5627904    b  W95 FAT32

Mount the iso image, and copy files from it 
su
cd /mnt/
mkdir iso live
mount -o loop -t iso9660 ~/Downloads/Fedora-Live.iso iso
mount -t ext3 /dev/sda8 live
cp -r iso/* live/

Alternatively, a better way might be -
livecd-iso-to-disk --noverify --overlay-size-mb 2047 Fedora-16-x86_64-Live-LXDE.iso /dev/sda8 


Examine the grub conf on the live distro -
cat /mnt/live/EFI/boot/grub.conf
..
title Fedora-16-x86_64-Live-LXDE.iso
  kernel /EFI/boot/vmlinuz0 root=live:LABEL=Fedora-16-x86_64-Live-LXDE.iso rootfstype=auto ro liveimg quiet  rhgb rd.luks=0 rd.md=0 rd.dm=0 
  initrd /EFI/boot/initrd0.img
..

Find the UUID of your live partition -

[steve@aspireone753 ~]$ ls -lF /dev/disk/by-uuid
total 0
lrwxrwxrwx. 1 root root 10 Nov 13 11:33 B381-1423 ->; ../../sda8

Then edit the regular grub.conf on your main linux installation. Changes needed are shown in bold.

sudo vi /boot/grub/grub.conf

paste in a new entry, copied from the live distro -

title Fedora-16-x86_64-Live-LXDE.iso
        root (hd0,7)
        kernel /EFI/boot/vmlinuz0 root=UUID=B381-1423 rootfstype=auto rw liveimg quiet  rhgb rd.luks=0 rd.md=0 rd.dm=0
        initrd /EFI/boot/initrd0.img

Reboot, and choose the live distro at the grub menu.

Fedora 16 Install

Well this didn't go so smoothly. I first tried to install from live usb - perhaps this was a mistake.
After partitioning, when beginning the install, it stopped with a filesystem error.
Frustrated also with LVM, I had tried the install without LVM.
I tried many partition layouts, including with LVM, but in the end was unable to resolve it.

Desperate, I did a fresh install of Fedora 15 (from DVD install media), using a custom layout (without LVM), which worked fine. From there yum upgrade from Fedora 15 to 16 went smoothly.

Wednesday, November 9, 2011

Picasa on Fedora

This you can find all over the web... but for my own use, and perhaps to save others browsing the many google results -

If you get this trying to run picasa -


/usr/bin/picasa: line 189:  8381 Segmentation fault      (core dumped) "$PIC_BINDIR"/wrapper check_dir.exe.so
/usr/bin/picasa: line 248:  8497 Segmentation fault      (core dumped) "$PIC_BINDIR"/wrapper set_lang.exe.so

Then install wine, and replace picasa's wine preloader with the one from the fedora wine install

cp /usr/bin/wine-preloader /opt/google/picasa/3.0/wine/bin/wine-preloader

And then, to allow sign-in to web albums -


cp /usr/lib/wine/wininet.dll.so /opt/google/picasa/3.0/wine/lib/wine/


Resizing LVM volumes

Just made the costly mistake of shrinking an LVM volume by booting from a DVD, and using lvm to resize directly. I should have read the following first -

http://www.linuxquestions.org/questions/linux-enterprise-47/shrink-lvm-without-dataloss-557746/

Seems the key step I missed was to use 'resize2fs' to resize the filesystem first.

Having re-installed... my next step is to put a second install on the hard disk, for future recovery work.