Thursday, August 25, 2011

Linux Mint 11 "Katya" on VAIO P - VPCP115KG Part 2

Backup
I use an USB hard disk cradle to store backup dump files. The hard disk is formatted in ext4 filesystem.
Prerequisite is to install dump utility first:
$ su -
# apt-get install dump


Let's create a snapshot:
# lvcreate -l 563 -s -n lv99.fss /dev/vg00/lv00
Start backing up / filesystem (assume the USB disk is mounted under /media/backup):
# dump 0uf /media/backup/20110822-vpcp115kg-lv00.dmp /dev/vg00/lv99.fss
When it completes, delete the snapshot:
# lvremove -f /dev/vg00/lv99.fss


The / backup takes 6 minutes 42 seconds.

Let's create a backup of /boot partition:
# dump 0uf /media/backup/20110822-vpcp115kg-boot.dmp /dev/sda1


The /boot backup takes 2 seconds.

The first backup we used snapshot, the second backup we did not use, actually we cannot use snapshot because /boot partition is not a logical volume. We use snapshot because we want a solid backup that we can restore it later. Since / filesystem is an active partition (try umount it), using dump might not guaranty a successful restore (the restore might be fine, actually), but the OS might have problem due to file inconsistency. On the other hand, /boot partition is not considered active, you can try umount it after the OS is up. Or umount it before taking backup.


Restore
To restore the / filesystem due to whatever reasons:
- Boot Katya using the boot media (the USB flash drive) with active network connection.


When Katya is ready, connect the backup media (assume it is mounted under /media/backup), then open a gnome-terminal:
$ sudo su -
# apt-get install lvm2 dump
Activate logical volume lv00:
# lvm lvchange -a y /dev/vg00/lv00
Wipe logical volume lv00:
# mkfs.ext4 /dev/vg00/lv00
# mkdir -p /media/lv00
# mount /dev/vg00/lv00 /media/lv00


Start restoring / filesystem:
# cd /media/lv00
# restore rvf /media/backup/20110822-vpcp115kg-lv00.dmp
When the restore completes (it takes about 10 minutes):
# sync
# rm restoresymtable
# cd /
# umount /media/lv00
Run a filesystem check against logical volume lv00:
# fsck /dev/vg00/lv00


Ignore this step if it is required to restore /boot filesystem, otherwise just issue the following two commands and stop.
# umount /media/backup
# init 6

Retrieve the UUID of /dev/sda1:
# blkid | grep '/dev/sda1'
/dev/sda1: UUID="e80248bf-2417-4d66-a104-b8dce0e34c71" TYPE="ext4"
To restore the /boot filesystem:
# mkfs.ext4 /dev/sda1
# mkdir -p /media/sda1
# mount /dev/sda1 /media/sda1
Start restoring /boot filesystem:
# cd /media/sda1
# restore rvf /media/backup/20110822-vpcp115kg-boot.dmp
When the restore completes (it takes about 20 seconds):
# sync
# rm restoresymtable
# cd /
# umount /media/sda1

Disconnect the USB backup media:
# umount /media/backup
Since /dev/sda1 was wiped previously, need to re-install GRUB2:
# mount /dev/vg00/lv00 /media
# mount /dev/sda1 /media/boot
# grub-install --root-directory=/media /dev/sda --force
# sync

Assign the old UUID to /dev/sda1:
# tune2fs /dev/sda1 -U e80248bf-2417-4d66-a104-b8dce0e34c71

Umount restored filesystems
# umount /media/boot
# umount /media
Run a filesystem check against /dev/sda1:
# fsck /dev/sda1
Deactivate logical volume lv00:
# lvm lvchange -a n /dev/vg00/lv00
# init 6


If you re-install GRUB2 previously, run the following command after reboot:
# update-grub

The OS is back to the previous stage of the last backup.


Intel EMGD (GMA500 driver)
There are four commands to enter (for more information, please refer to the instructions found in Ubuntu wiki "Poulsbo" 2.1):
# add-apt-repository ppa:gma500/emgd
# apt-get update
# apt-get install xorg-emgd emgd-dkms emgd-xorg-conf
# emgd-xorg-conf


Don't reboot yet, copy the configuration from this page and save it as /usr/share/X11/xorg.conf.d/10-emgd.conf, then go ahead to reboot:
# init 6


Once it is rebooted, Compiz can be activated!


Brightness Function Keys Fix
Install emgdbl package:
# apt-get install emgdbl


Edit the following line in /etc/default/grub (added settings are highlighted in blue):
GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=video mem=1920mb"


Append the following line in /etc/modprobe.d/blacklist.conf:
blacklist poulsbo

Append the following line in /etc/initramfs-tools/modules:
emgdbl


Generate a new initramfs image:
# cd /boot
# cp -p initrd.img-2.6.38-11-generic initrd.img-2.6.38-11-generic.20110825
# mkinitramfs -o initrd.img-2.6.38-11-generic

# init 6

After reboot, the F5 & F6 keys are resumed.


Other Little Hacks
Disable tty2 - tty6 by editing /etc/init/tty[2-6].conf:
Comment the following line:
#start on runlevel [23]


Disable the following services from Startup Applications Preference in Control Panel:
- Bluetooth Manager
- Dropbox
- GNOME Login Sound
- GSettings Data Conversion
- mintWelcome
- Personal File Sharing
- PulseAudio Sound System KDE Routing Policy
- Visual Assistance
- Zeltgelst Datahub


In Keyboard Shortcuts, assign Launch web browser action to the "WEB" key. Once it is assigned, the default browser will be launched when you press the "WEB" key in Gnome.




3 comments:

  1. Know you posted this some time ago....but hope you can still help please....

    Trying to get Linux Mint 15 running properly on my VAIO P (VPCP11AKJ model).

    Installed OK, but get message 'Running in Software Rendering Mode'...assume that relates to the GMA500 drivers being missing.

    When I tried to go to the link in your post regarding EMGD configuration file, it says that page does not exist.

    Is it possible to get a copy of this text from you?

    Thanks,

    Mark

    ReplyDelete
    Replies
    1. Hi Mark,
      #apt update; apt upgrade

      Then install latest 'linux-image-extra-3.8.0-25' kernel and it fixes everything.

      Kind regards,
      David

      Delete
  2. Hi David,

    THANKS for your quick reply and input...greatly appreciate it!

    OK, wil try that once I fix grub... ;-)

    Did another linux install on another partition and reinstalled grub....that caused Win7 not to boot....so, did 'fixmbr' and now, no grub nor Win7....just boots up to a Windows screen that shows error message....

    Gotta figure out how to restore/reinstall grub and then I can boot Linux Mint again to try your suggestion...always something it seems...

    Thanks,

    Mark

    ReplyDelete