Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
software:files [2010/03/27 12:23] cyril created |
software:files [2022/12/24 00:07] (current) cyril [Digital Will] |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Files management ====== | ====== Files management ====== | ||
+ | |||
+ | ===== Backup ===== | ||
+ | |||
+ | Everyone has personal data that nothing could recreate (pictures, emails, creations, ...), or global data and configuration that it would take a lot of time to recreate. However you can lose some of them or all of them in several situations: hard drive crash, hard drive corruption, computer theft, computer destruction (fire...). | ||
+ | |||
+ | My advice: | ||
+ | * partition your hard drive to have a separate partition for system and data | ||
+ | * put important application data on the data partition (configuration, | ||
+ | * do a full mirror backup of the data partition regularly (eg with rsync or a deduplicate software such as Attic) on an external hard drive or a network drive. Try to keep at least one copy somewhere else from your home (network drive, or one at home and one at work). | ||
+ | * take precautions to put the odds on your side in case of problem: make copies of your disks MBR (output of command p of fdisk), of your encrypted partitions headers, etc. | ||
+ | |||
+ | ===== Digital Will ===== | ||
+ | |||
+ | The goal is threefold: | ||
+ | * No one non-authorized can ever access to your data | ||
+ | * The trusted persons can only access to your data in some conditions (deceased, coma, ...) | ||
+ | * You are alerted when your data is accessed by the trusted persons (in case the access was not legitimate) | ||
+ | |||
+ | Different approaches: | ||
+ | - A service that gives your data to designated persons when they provide a death certificate for you (Wishbook, ...) | ||
+ | * Cons: sending a fake document, does not work for coma, service needs to remain available, price, incomplete control. | ||
+ | * Variants: store it directly in a vault at the bank, or at the notary. | ||
+ | - A service that regularly checks that you are alive by requesting a connection with your private credentials (period can be adapted to the situations), | ||
+ | * Cons: there will be some delay between when you stop pinging and when your data becomes available, service needs to remain available, and if you host it yourself there is still a risk that your server crashes at the wrong time. | ||
+ | - A service that waits for a request to reveal your data with a personal password, sends you one or several emails to warn you that this request has been made, and in the absence of opposition from you in some delay (that can be adapted to the situation) sends your data (can be self-hosted). | ||
+ | * Cons: there will be some delay between when you stop pinging and when your data becomes available, service needs to remain available, or if you host it yourself there is still a risk that your server crashes at the wrong time (but if the service is associated to your password manager for instance, then the availability is not a problem anymore...) | ||
+ | - Split the secret between several people (cf [[https:// | ||
+ | * Cons: people need to remain accessible (and not loose the information), | ||
+ | - Store your key on a piece of opaque paper (eg visit card), with you (eg in your smartphone), | ||
+ | * Cons: need to actively monitor the integrity of your artifact, doesn' | ||
+ | * Variant: it seems that it is possible to make "paint to scratch" | ||
+ | |||
+ | Different methods could be combined, for instance 2 or 3 plus 4. But 3 managed by the password manager is probably unbeatable. | ||
+ | |||
+ | Ideally, for increased safety, the data to be obtained is always encrypted with a key that the designated persons possess. | ||
+ | |||
+ | What to transmit? | ||
+ | * Passwords (master password of your password manager, computer, encrypted data partitions, phone, ...) | ||
+ | * Instructions about what data you have | ||
+ | |||
+ | Notes: | ||
+ | * Different levels of amount of information for your spouse, children, other family, friends? | ||
+ | * How to transmit data (such as pictures) to a child? Probably has to go through a tutor. | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ===== File Systems ===== | ||
+ | ==== ext3, ext4 ==== | ||
+ | === Reserved blocks === | ||
+ | By default ext3 reserves 5% of disk space to super-user. The intent is to let to critical applications the ability to write to the disk when it is full, but it has no use for a data partition, you just waste 5% of your partition. | ||
+ | |||
+ | You can check and remove these reserved blocks with the following commands: | ||
+ | < | ||
+ | tune2fs -l /dev/sda1 | grep Reserved | ||
+ | tune2fs -r 0 /dev/sda1 | ||
+ | </ | ||
+ | |||
===== Duplicates ===== | ===== Duplicates ===== | ||
- | * gqview | + | * geekie |
* fdupes | * fdupes | ||
* fslint | * fslint | ||
Line 11: | Line 69: | ||
* secure-delete (srm, sfill, sswap, smem) | * secure-delete (srm, sfill, sswap, smem) | ||
+ | * -l option to be a lot faster: 2 passes instead of 38 (or -ll for only 1 pass), enough to prevent the use of consumer tools like photorec, but not for specialized companies and governments ;-) | ||
* shred (less advanced but more common) | * shred (less advanced but more common) | ||
===== Data recovery ===== | ===== Data recovery ===== | ||
+ | First unmount your partition and remount it read-only. | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | ext3grep < | ||
+ | ext3grep < | ||
+ | ext3grep < | ||
+ | ext3grep < | ||
+ | ext3grep < | ||
+ | ext3grep < | ||
+ | </ | ||
+ | * '' | ||
+ | * others: debugfs, foremost, [[http:// | ||
+ | |||
+ | ===== Disk Recovery ===== | ||
+ | |||
+ | In case the MBR/ | ||
+ | |||
+ | ==== Make a backup before ==== | ||
+ | |||
+ | You should always keep a backup of your partition table ! | ||
+ | |||
+ | The first way is to store the output of p command of '' | ||
+ | |||
+ | You can also do a dump of the MBR and EBR: | ||
+ | <code shell> | ||
+ | dd if=/dev/sda of=sda.dd bs=512 count=1 # full MBR dump | ||
+ | sfdisk -d /dev/sda > sda.sfdisk | ||
+ | </ | ||
+ | |||
+ | Out of curiosity, the '' | ||
+ | <code shell> | ||
+ | file sda.dd | ||
+ | </ | ||
+ | |||
+ | ==== Restore with a backup ==== | ||
+ | |||
+ | If you have the output of the p command of '' | ||
+ | |||
+ | If you have a full dump of MBR and EBR, you can automatically restore it: | ||
+ | <code shell> | ||
+ | dd if=sda.dd of=/dev/sda | ||
+ | sfdisk /dev/sda < sda.sfdisk | ||
+ | </ | ||
+ | |||
+ | To restore the MBR without the partition table: | ||
+ | <code shell> | ||
+ | dd if=sda.dd of=/dev/sda bs=446 count=1 | ||
+ | </ | ||
+ | |||
+ | To restore only the partition table: | ||
+ | <code shell> | ||
+ | dd if=sda.dd of=/dev/sda bs=1 skip=446 count=66 | ||
+ | </ | ||
+ | ==== Restore without a backup ==== | ||
+ | |||
+ | If you don't have a copy of your partition info, don't panic, some software can recover them by searching for the partitions in the disk content (but it has to be formatted as a standard filesystem, ie not encrypted): | ||
+ | * testdisk (very good) [[http:// | ||
+ | * gpart (didn' | ||
+ | |||
+ | ==== Performance optimization ==== | ||
+ | |||
+ | * e4rat ([[http:// | ||
+ | * preload ([[http:// | ||
+ | * prelink | ||
+ | |||
+ | * verynice | ||
+ | |||
- | * testdisk (photorec) |