Archive

Posts Tagged ‘Linux’

Hibernate on EeePC 900A

Written on October 18th 2008, 00:10 by sYnie

Before I start to talk about hibernate, I want to mention a very strange behavior of the 900A. The internal SSD is named sda OR sdb, depending on whether there is a card in the card reader at the system startup. So if there is a card plugged in, the internal SSD will be flagged as sdb. If there is no card, it will be sda. WTF? I really have no idea what this is caused by. But I think this causes a problem with hibernation.

At first, I didn’t even realize, that the internal SSD changes its device name. I use Ubuntu eee and during the installation, the fstab and menu.lst were filled with UUID’s instead of the device names – So there is no problem with booting and mounting them.

Anyway, I tried to get hibernation aka suspend to disk to work using this tutorial:
http://www.ubuntu-eee.com/wiki/index.php5?title=Fix:_hibernate

Everything seemed to work. s2disk caused the notebook to hibernate (as long as i didn’t insert/remove a card), but the wakeup ended in a ordinary boot, without resuming the written image. After hours, I got it work. Just do exactly the same, as it’s described in the tutorial, except for one step.
When you’re asked to change the /etc/uswsusp.conf, don’t use any device names in it. Do it, as Ubuntu did it during the installation: Use UUID’s.
To get to know the UUID of the internal SSD, we have to find out, how it’s labeled:

mount

This will return something like this:

/dev/sdb1 on / type ext3 (rw,noatime,errors=remount-ro)
proc on /pro....

Now, we know our SSD is /dev/sdXX (sdb1 in my case), because it’s mounted to /. In the next step, we’ll get to know the UUID:

sudo vol_id /dev/sdXX |grep UUID=

This will return the UUID. In my case:

ID_FS_UUID=16fa07c8-8416-5f10-85c6-a8410fad510

And now we’ll use this UUID instead of the device name in /etc/uswsusp.conf:

# /etc/uswsusp.conf(8) -- Configuration file for s2disk/s2both
resume device = /dev/disk/by-uuid/16fa07c8-8416-5f10-85c6-a8410fad510
compress = y
early writeout = y
image size = 0
RSA key file = /etc/uswsusp.key
shutdown method = platform
resume offset = XXX

If you’ve found this site after you already tried the tutorial mentioned above, then just do the changes and run this at the end:

sudo update-initramfs -k `uname -r` -u

Otherwise hibernate will create the image but it won’t be booted.

And now, for me, it works *woohoo*
I hope this will help ;-)

Linux on USB

Written on November 30th 2006, 13:11 by sYnie

Once this was a very detailed post about which distribution to use on a USB stick and how to get that managed. As I just translated it for devl.net, I keep it short.

I have used Slax in order to install it on a USB stick. Just plug it into any (new) computer, and it’ll boot from it (as long as the mainboard is able to do this and as long as it’s activated in the BIOS). Every Linux user will know the benefits of a full OS on a USB stick.

This is a short how-to about installing Slax on a USB stick:

  1. Plug in the stick and type `dmesg |tail` in order to get to know how the stick is named. Usually it’s sda or the partition sda1, which I’m also using furtheron. (Use your own device name instead of sda)
  2. Create partition table: `cfdisk /dev/sda`. Format the whole stick as Fat32 (Type 0B). Also give it a “Bootable Flag”. After writing, it should look something like this: sda1 Boot Primary W95 FAT32 [ ] 1022.92
  3. Format: `mkdosfs -F 16 /dev/sda1` creates a Fat16 partition, which can be also read by windows.
  4. Create a directory called “usb” (or whatever) in /mnt and mount /dev/sda to it: `mkdir /mnt/usb && mount /dev/sda1 /mnt/usb`
  5. Download Slax. It’s not important which version you use. I downloaded Slax Popcorn Edition.
  6. Open a shell and go to the directory where you have downloaded slax to  (`cd /home/you/whereever/downloads`) and create a directory called ‘usbslax’ by typing `mkdir usbslax`.
  7. Mount the iso to the just created directory: `mount -o loop slax-*.iso usbslax`.
  8. `cp -r slax/* /mnt/usb` will copy all the data to the USB stick.
  9. Go to the stick (`cd /mnt/usb`)
  10. copy isolinux.cfg to syslinux.cfg, as we want to use syslinux: `mv isolinux.cfg syslinux.cfg`
  11. Copy the kernel and initrd to the root directory of the stick, as it won’t be a live CD: `cp boot/vmlinuz boot/initrd.gz ./`
  12. Open syslinux.cfg in a any text edit tool (e.g. `vim syslinux.cfg`) change every  ‘/boot/vmlinuz’ to ‘vmlinuz’ and ‘/boot/initrd.gz’ to ‘initrd.gz’.
  13. Unmount: `cd .. && umount /dev/sda1`
  14. Install Lilo to the stick: `lilo -M /dev/sda` [grub didn't work for me]
  15. Make it bootable: `syslinux -s /dev/sda1`
  16. Reboot and enjoy: `sudo reboot`