Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding partID and a partition recognition process #2664

Closed
third3ye opened this issue May 15, 2014 · 1 comment
Closed

Adding partID and a partition recognition process #2664

third3ye opened this issue May 15, 2014 · 1 comment

Comments

@third3ye
Copy link
Contributor

Sometimes partition tables are corrupted, harddrives are damaged or disfunctional and pertinent data needs to be retreived. In certain situations when you're dealing with deployment strange stuff happens. Like sometimes people will want to get the entirety of their systems from one harddrive to another. Dealing with Windows without their new imagex system has many a time been a pain in my tuchus. But Nix(OS) however should be able to "automagically" facilitate this process easily. Now before you go on about how this filesystem supports this kind of redundancy and that kind redundancy remember: we want a general tool that can be used with Nix, to not only install and manage systems, but IMHO to easily reinstall them without much hastle (just a couple of nix files, a copy of the partition, and you're set).

So what I would suggest is adding a new file to /etc/nix/ that contains a store of information required to identify partitions, that is created or added to under the install or rebuild process. To coin a function like this is hard though, so I'll just call recognise:

fileSystems."/" = { 
  device = "/dev/sdb3";
  fsType = "ext4";
};
fileSystems."/nix/store" = { 
  device = "/dev/sda2";
  fsType = "btrfs";
  autoFormat = true;
};
fileSystems."/home" = { 
  partID = "21d70c40-83f8-400c-b6ac-510fc7449dab"; # Just a reference point
};

As you see this setup does three things: it mounts root, it formats /nix/store partition on install/rebuild and the /home partition just has a partID. The reason the partID is even included (and maybe need re-coining) is to use it as an index number, really. The process should then check something like /etc/nix/partid.bin, through a secure process (in any case only nix and root should have access to it), for recognizable values or patterns that may identify this partition. In any case if you have a damaged partition we can start discussing how to facilitate an interactive "attempt to fix" process, or through declarations for that matter.

In any case it would make moving from system to system a breeze, which is again more of usability than functionality. But I'd still like to see something like this...

@third3ye third3ye changed the title Adding filesystems-id.nix and a partition recognition process Adding partID and a partition recognition process May 15, 2014
@Profpatsch
Copy link
Member

No actionable items @jagajaga

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants