Moving home to it’s own partion (Ubuntu)

We are going to move all accounts including their personal data on a distinct partition. This recommended in case of system failure to not loose any data.
I have no idea, why the Ubuntu installation wizard does not do this by default — it should!

This post is based on an article in German – I will mainly translate it, strip some plush and add some stuff to make life easier and to reduce the risk of data loss. But be aware: to perform any of those following things, you will need super user rights and you should feel somewhat comfy with using the command line. And of course, it might be possible in circumstances unforeseen, that you lose all your personal data — but there are a lot of backup steps included below.

Here we go: (console input or statements are written in italics)

  1. Preparation
    1. Create a backup: rsync -avx –progress /home <your backup destination>
    2. If you do not have a free partition yet, I recommend GParted to create one (use sudo apt-get install gparted). I recommend ext3 for compatibility issues — but if you use Linux only, you can go for ext4 (please change ext3 to ext4 in step 1.6 in case) — make sure your new partition is big enough for your home folder! Try to remember the size (get size: du -sh /home) of /home, you can use it later on to verify your new home location.
    3. Get partion name sudo fdisk -l /dev/sda — e.g. /dev/sda7 — I will refer to this name as (name)
    4. Copy your current file system configuration: sudo cp /etc/fstab /etc/
    5. Get partion UUID of new partition: sudo blkid — you will find a line about (name) stating a UUID (quite a long hex string), I will refer to it as (uuid) — copy it.
    6. Edit /etc/, add a new line at the end as follows (the layout should follow previous lines – simply copy one and adjust it):
      UUID=(UUID)  /home                ext3         defaults                    0  2
  2. Copy
    1. Sign off / Log out
    2. Switch to console mode by pressing Ctrl+Alt+F1
    3. Create a mount point for the new partition: sudo mkdir /mnt/tmp
    4. Add partion: sudo mount (name) /mnt/tmp
    5. Copy home from the old location to the new partition: sudo rsync -avx –progress /home/ /mnt/tmp
    • Test
        1. Mount copy of home as new home: sudo mount (name) /home
        2. Check size of home folder — should be the same as in step 1.: du -sh /home
        3. Check mounting worked: sudo mount| grep /home should print out something like
          (name) on /home
        • Switch
            1. yet another home backup: sudo mv /home /home.bak
            2. create new home mount point: sudo mkdir /home
            3. create a backup of fstab: sudo mv /etc/fstab /etc/fstab.bak
            4. put updated version in place: sudo mv /etc/ /etc/fstab
            5. reboot and you should be done: sudo reboot

            Ok, that’s that. If everything works fine, you can delete the backup home sudo rm -rf /home.bak and the fstab backup sudo rm /etc/fstab.bak. Hope you found it useful and I did not put in a mistake or typo. Gimme feedback! 🙂

            Getting Drupal’s Access Control Module to Work Properly

            After setting up some content types — some public, some internal. I installed the Access Control module, set up internal content not to be visible to anonymous users — but without any effect.

            After some research, but without success, I realized the *Advanced* section at the bottom of the Access Control tab for each content type. And now the magic trick: Increase the weight and you are done. So I guess the build in access management was fighting the Access Control module, so it is up to you to make your favorite module stronger by giving it more weight. — I doubt this is intuitive. Additionally, it is for sure difficult to simply find the tiny little select box down there in a section, which is by default folded.

            KDE vs. Gnome

            Now, my decision is final: KDE rules (though I actually prefer the look of Gnome 🙁 ).

            Simple reason: Gnome does not support drag-and-drop in combination with alt+tab (see bug tracker), but there might be hope with the upcoming Gnome 3.

            [Edit 2011-06-14: Indeed, drag-and-drop + alt-tab works since since Ubuntu 11.04 (did not try with 10.10). One major difference remains: Do you need a lot of configuration and customization options? And are you will to accept complex, maybe not that self-explaining menu structures for that? If yes, KDE is your choice, otherwise Gnome might make your life easier. See also this page for more details and screenshots.]

            In more detail: using drag-and-drop together with alt+tab key combination allows to work very efficiently. For example, while ordering my photos, I want to work on one of them — as I do this regularly, Gimp is opened already, but in the background — so what I do using KDE or MS Windows is, I grab the picture, switch to Gimp by using alt+tab and immediately drop the picture without moving the mouse at all – I am quite confident that this is the fastest way of opening a picture for editing. Some people advice to set Gimp as default application to open JPEGs, but I am not always editing pictures, most of the times I just want to view them.

            Using “Open With” on a JPEG file for sure is the common approach – but let’s compare it:

            • Drag-and-drop & alt+tab
              • Actions to be performed: mouse down + key down + key up + mouse up
              • In total: four fast steps
            • “Open With” solution (holding mouse down as improvement)
              • Actions to be performed:mouse down + moving to “Open With” + wait for sub-menu to open + move to sub-menu + mouse up
              • In total: two fast, three slow steps

            How to Make Jquerymenu for Drupal Keep its State on Page Reload

            While setting up the website for my new project “Glocal”, I came across the problem of finding a proper menu module. Something easy to use, stable and efficient in the same time for the complex intranet structure (therefore, sorry, but you will not be able to see my solution there unless you are a project member). Something with a high usability in the end. Activemenu is still quite buggy and DHTML Menue requires a double click to actually open a page — unbearable in a non-doulbe-click environment like the Internet — who is supposed to guess, that this menu requires a double click?? Leaving me with JQuerymenu.

            First impression: perfect! Open and close branches by clicking (+) or (-) — view page by clicking menu item label. Even the few styling issues could be fixed easily by using CSS. But as soon, as someone clicks a label, the menu collapses to its default status. It does not remember its last status after loading a different page with the same menu.

            Is this it? All module have critical downsides like this? I was quite disappointed! 🙁

            But I taught JQuerymenu to remember!

            As it is quite some code, I will not post it here directly, but added it to the tracker page for this “feature request” or you can download the two updated files (jquerymenu.js and jquerymenu.module) here and replace the once in your /sites/all/modules/jquerymenu folder.

            But please be careful, it should be considered an alpha version, there are quite some weaknesses (see tracker page). Any feedback or suggestions are very welcome!