Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Call for help: Let's fix the DroboFS OS
04-01-2011, 03:31 AM
Post: #1
Call for help: Let's fix the DroboFS OS
Hi everyone,

I think I found an easy way to fix all the DroboFS OS foibles in one fell swoop.

A bit of background first: we have a serious problem with the handling of user accounts and passwords. The whole thing about accounts added by adduser being reset at reboot it, to say the least, annoying. Also, the whole thing about having to mess with PATH to make sure that installed apps are easily accessible is kind of a drag.

The solution: we "replace" all the folders in the FS. Are you terrified yet? No? Good, because it is not as bad as it sounds.

One of the cool things about Linux is that you can override a folder without deleting its contents and transparently for all applications. The way to do this is to use a special mount command-line:
Code:
mount -o bind /source/folder /folder/to/be/overridden

Imagine, for example, that you want to have a persistent version of /etc/passwd, that would be restored at every boot. Right now, unless you replace the file manually after boot, it will be restored to one of the several copies that the FS keeps hidden. Instead of that, you could do this:
Code:
mount -o bind /mnt/DroboFS/etc /etc
And now the freshly-reset /etc/passwd get "replaced" by the one in /mnt/DroboFS/etc/

The nice thing about this is that if you want to go back to the original version, you just umount /etc and all the original files are immediately available again. Nothing is lost, and can be easily restored.

So here is the plan in a nutshell: we replicate the folders under "/" inside /mnt/DroboFS and then remount each one of them. This way we can modify the OS to our hearts content (well maybe not everything) in a way that is easily undone. Here is what it would look like:
  • /etc -> /mnt/DroboFS/etc
  • /root -> /mnt/DroboFS/root
  • /home -> /mnt/DroboFS/home
  • /tmp -> /mnt/DroboFS/tmp
  • /usr -> /mnt/DroboFS/usr
There is just one problem: how to populate the folders under /mnt/DroboFS with the original files. I propose this pseudo-code:
Code:
funcion remount_folder(FOLDER) {
  mkdir -p /mnt/DroboFS/$FOLDER
  touch /mnt/DroboFS/$FOLDER/.copied
  if /$FOLDER not exists
    mkdir /$FOLDER
    if mkdir not successful, abort
  else if /$FOLDER exists and /$FOLDER/.copied not exists
    cp -R /$FOLDER/* to /mnt/DroboFS/$FOLDER/
    if copy not successful, abort
    touch /$FOLDER/.copied
  fi
  mount -o bind /mnt/DroboFS/$FOLDER /$FOLDER
}
As you can see, it supports both folders that already exist (e.g. etc) and folders that do not exist, but would be nice to have (e.g. home).

I think it should be possible to package this as a DroboApp, but there are a few snags. For instance, how to make sure that this is the first DroboApp executed? Also, what about critical folders like /bin and /sbin? Even /usr may be a little bit too risky, since NASD is in /usr/bin.

Anyway, feedback would be most welcome on this idea. I think that if this works it may be a big step towards making the FS much easier to use, and make people more comfortable tinkering with it since any problems can be easily undone.
Find all posts by this user
Quote this message in a reply
05-07-2011, 07:38 AM
Post: #2
RE: Call for help: Let's fix the DroboFS OS
I can't help but notice you posted this on April 1st... ?
Find all posts by this user
Quote this message in a reply
05-07-2011, 09:49 AM
Post: #3
RE: Call for help: Let's fix the DroboFS OS
Pure coincidence. I have already managed to halfway fix my FS, so that /root and /home are remounted at boot.

I still need to remount all the other folders (/etc, /bin, /usr, ...), but I've been caught up on other stuff in between.

The end goal is to have a package manager working. I think that if the filesystem behaves more like a standard distro, then it will be a piece of cake to have a package manager running.
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: