aufs and mount.posixvol

Discussion in 'Linux' started by kevin, Sep 25, 2008.

  1. kevin

    kevin

    Joined:
    Sep 18, 2008
    Messages:
    274
    Likes Received:
    0
    I've been wondering about whether the `storage expansion' mechanism used by Linpus is worth the effort, There seems to be an awful lot of plumbing to make it work, and it can't be very efficient. For example, writes to the user home directory /mnt/home that end up on the card have to go through aufs, then through the posix compatibility layer, before reaching the disk.

    I was rather hoping that if I formatted a memory card as ext2, the aufs stuff would recognize the fact that the posix compatibility layer was not needed, and not start it up. No such luck.

    It seems very odd that the AAO works the way it does here. I don't think there's a general intention that the storage expansion slot be used for cards that are inserted and removed willy-nilly, so why does it not just format them as ext2/3 in the first place?

    I'm wondering if it might be better to put the home directory for the default user `user' permanently on an expansion card and mount it directly on /mnt/home during boot. Then I'd leave the whole of the internal SSD for apps, etc. Probably set $HOME to the same place somewhere. Or mount the card on /home/user and figure out what is necessary to make Thunar, etc., treat this as the home directory rather than /mnt/home. Or just make /mnt/home a symlink to /home/user. Or something.

    What I'm wondering is what else will break if I do this. How many other internal bits assume that aufs is running, and will fail if it isn't? Will there be problems with suspend/resume? Do I need to disable the card insertion detection process? (What does it do anyway?)

    Has anybody tried this?

    Comments welcome.
     
    kevin, Sep 25, 2008
    #1
  2. kevin

    annafil

    Joined:
    Aug 12, 2008
    Messages:
    327
    Likes Received:
    0
    Location:
    Malaysia
    kevin - not really a problem to have just the SD as your home directory - provided you never ever take it out...It is often recommended on linux to have /home as a separate partition altogether, so a separate drive isn't too much of a stretch.

    It may break the shortcuts list in the file browser, the one on the left hand side, but seeing as how the system is capable of running without the SD car,d it should be equally capable of running /home off the SD card.

    What you can probably do is just comment out the script that handles the aufs (i can't remember offhand where it is but I can find it for you), and add a line to the fstab to permanently mount the SD card as /home. The SD card will probably need a unique label to use in the /etc/fstab file - its the only good way to distinguish the left hand side card reader from the right - by the label on the disk. You can use a tool called gparted to add a name to the card nondestructively..

    The folder structure on the card will have to be different. The card will HAVE to be ext2 because it needs to house a folder "user", and inside that your regular folders..

    I can come back and write up some mode detialed instructions or you could PM me if you like.. was thinking of doing this myself when I got a bigger SD card... :)
     
    annafil, Sep 27, 2008
    #2
  3. kevin

    kevin

    Joined:
    Sep 18, 2008
    Messages:
    274
    Likes Received:
    0
    I've done it. I was _horrible_.

    The first step was to disable all the storage management stuff at startup. Otherwise you get a load of pointless processes interfering with everthing. That mean fiddling around with dbus scripts. Then I formatted the card as ext2 and created directories on it for my work. I didn't want to put my _whole_ home directory on the card, because I couldn't be sure I'd never have to take it out. Then I symlinked my work directories from /media/disk into /home/user. Then I deleted /mnt/home and made it a symlink to /home/user. Otherwise _everything_ in Linpus breaks.

    The tricky part was ensuring that the left slot always got mounted as /media/disk and the right slot as something else, when booting with both cards installed. I had a fruitless hour trying to do this with udev rules, but I found in the end that Thunar/Gtk seems to ignore the device nodes when deciding what to mount where. In the end I was able to fix this by putting UUID=... mounts explictly into /etc/fstab. I still don't understand the interaction between Thunar and the OS mount infrastructure, but it seems to work so far.

    There is still a problem that Thunar has been munged by Acer, presumably to report the home directory /mnt/home as if it was a disk partition, so it gets its own entry in the left pane. That, presumably, is to hide the rest of the OS from casual browsing. The SD mounted at /media/disk does not get its own entry in the left pane, even though it is a removeable device.

    Also Thunar continues to report the combined capacities of /media/disk and / as the size of `My Disk'. But I guess that's not a huge problem.

    Anyhow, I now have most of my home directory on the left-hand SD, with none of the silly posixvol stuff, and a 16Gb card in the right slow for general use. Everything seems to work, but I can't be sure what other Acer munges are in their waiting to trip me up :)
     
    kevin, Sep 27, 2008
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.