User Tools

Site Tools


howto:makechangespermanent

Make Changes Permanent

It would be interesting to update or remove packages on the eee and retain those after a restore. Problem is that such changes are not retained and/or take up precious space on the user partition. While you can rely on additional images (e.g. http://www.xepc.org), we want some control over what we do…

UnionFS

This is a brief overview of how unionfs works.

First, you have two (main) partitions on your ssd - sda1 and sda2. sda1 is the system partition, it has everything that your computer has from the factory. sda2 is the user partition. it starts empty.

The unionfs mounts *both* of them to the same place. Changes made to the unionfs are saved in the user partition - deleting a file in normal operation:

1) if the file is on the user partition, delete it.
2) if the file is on the system partition, write a zero byte file to the user partition with the name ".wh.xxxxxxx"
     where xxxxxx is the name of the file in the system partition. (this is all invisible in normal operation)

This means that in practice, /dev/sda1 is read-only when the system in operating normally. For any change to be permanent, i.e. still be there after a restore, you'll have to actually change /dev/sda1.

Switching off UnionFS

There's a number of ways listed in http://forum.eeeuser.com/viewtopic.php?id=1891

The most convenient (as it will allow you to do other stuff later) I found was to change the grub boot menu to include a “No UnionFS”-boot. It's best to start from a clean system, and as you're going to mess with /dev/sda1/ as root, you can (will?) mess things up: make sure that you know how to restore from the DVD before you start!

What do you need?

  1. an eeePC (of course)
  2. a ram fs image that doesn't use unionFS. You can make your own (see Removing UnionFS/aufs) but it's easier to get it from http://www.technfun.com/various/eeepc701-4g/initramfs-eeepc-nounionfs.img (but this file does not work for the 901)
  3. some basic linux knowledge (how to edit and copy files)

Getting Started

  1. in normal user mode, open a terminal window (CTRL-ALT-T)
  2. copy the grub boot menu to allow editing: cp /boot/grub/menu.lst /home/user
  3. in your favorite editor, open /home/user/menu.list (e.g. nano /home/user/menu.lst) and copy the Normal Boot lines (4 lines starting with tile, root, kernel and initrd) twice, underneath that entry
  4. Change the first COPY (not the original code) to read
             title Rescue Console
            (leave root alone)
            kernel (whatever is there) XANDROSBOOTDEBUG=y
            (leave initrd alone)
  5. Change the second COPY to read
            title No UnionFS
            (leave root alone)
            (leave kernel alone)
            initrd /boot/initramfs-eeepc-nounionfs.img

- You should also check the fallback=2 line near the top of the file. If the system fails to boot properly Grub will use the specified fallback entry on the next boot attempt. The number 2 means that the third entry will be tried. (the first boot entry is 0) Replace the number 2 with the desired boot entry number. For example, if you want to fallback to the newly added Rescue Console entry, and if you placed it after the Normal Boot entry, change fallback=2 to fallback=1.

  1. save and exit the editor
  2. make sure you have a copy of initramfs-eeepc-nounionfs.img somewhere (I'll assume you've put them in /home/user; they could be on a memory stick but you'll need to mount that first somewhere. If your eee has two hard drives, like the 901's 4 + 16, create it and the menu.lst in /boot instead of /home/user, so that you will know where to find the file. Change the cp path below from /mnt-user/home/user to /mnt-user/boot.)
  3. now start the system in Single User mode also know as Rescue Mode: starting_single-user_mode
  4. mount the two partitions so you can copy files between them
            mount /dev/sda1 /mnt-system
            mount /dev/sda2 /mnt-user
  5. copy the menu.list and initramfs files
            cp /mnt-user/home/user/menu.lst /mnt-system/boot/grub/
            cp /mnt-user/home/user/initramfs-eeepc-nounionfs.img /mnt-system/boot/
  6. unmount (important!)
            umount /mnt-system
            umount /mnt-user
  7. Now wait at least 30 seconds. The umount steps and the waiting are there to make sure all data is written to the disk and all disk caches are flushed. If you skip these steps it might be that your data gets corrupted.
  8. if everything went OK, you should have two new options in the grub menu (press F9 when booting)
  9. if you select the No UnionFS option, you should get all the initial startup questions again (licence agreement, region, *)
  10. after booting, you're working on /dev/sda1 so all changes made there will become permanent. This goes for everything from bookmarks to themes to installed packages - BE CAREFUL!

Notice, that booting into the no-unionfs assumes that the simple desktop is used. If you already applied the advanced desktop tricks (see Enable Advanced Desktop Mode) then you might end up in a dead-end boot loop. As a simple solution you could first switch to the simple desktop, and then reboot int the no-unionfs mode, or you could apply the advanced desktop mode changes directly into the /dev/sda1 “read-only” partition. Doing so requires booting into single-user mode (Rescue Mode or: How I Learned to Stop Worrying and Learned to Love Single-User Mode) and manually applying the steps necessary to make the system be aware of simple/advanced mode.

Examples of what you can do

  • Remove or update openoffice: Upgrading OpenOffice.org from 2.0 to 2.3.1
  • update Firefox from 2.0.0.7 to 2.0.0.* (download the tar.gz file from Mozilla and extract in /opt)
  • make Firefox changes/plugins/themes/etc permanent: see Creating more screen space in Firefox for ideas
  • Remove packages you don't want/need (e.g. pidgen, thunderbird, scim, voice-command,…) using apt-get remove
  • update samba to more secure version (use the ftp.linux.hr repository)
  • install wifi access points you frequently need: if you activate it while in No UnionFS mode, it'll stick. Good for your home/work/etc AP you use frequently!

At the end, it's probably a good idea to tidy up: apt-get leaves the packages in a cache (it may even run out of space). Just rm *.deb from /var/cache/apt/archives. Maybe also look in /var/log to see whether anything can go from there…

Finishing

After you're done, simply reboot or even better, do a factory reset. Everything you've done will still be there!

If you need to make more changes later, you can boot to No UnionFS again, make the necessary changes permanent and boot again to the normal state.

Once you're happy with what you've done, it's probably a good idea to back up /dev/sda1 to an external device. There's enough topics on the wiki/forum that detail how to do this. Just in case, note that a restore from the ASUS DVD will overwrite /dev/sda1 with the original image and your changes will be gone!!!

See also: http://forum.eeeuser.com/viewtopic.php?id=1891

Thanks to: eee_jma, nevinera and loads of others who have contributed to the wiki & forum…

rio b and you sfr rio sosh bouygues

howto/makechangespermanent.txt · Last modified: 2012/01/27 19:50 by hello