Skip to main content
14 votes
Accepted

Restore ZFS Pool and storage data after a system re-install

If the disks are recognized from your OS the command: zpool import should be enough to get the pool imported and visible in your current OS. You can check the status with command zpool status You ...
Romeo Ninov's user avatar
  • 18.1k
13 votes
Accepted

Backup my EFI boot entry for easy restore

It's easy enough to recreate a boot entry from scratch once you know how... and have the efibootmgr tool at hand, of course. Boot0000* debian HD(13,GPT,007a058a-8e5e-45df-8d97-6575b66b5355,...
telcoM's user avatar
  • 103k
12 votes
Accepted

Backup and restore IMAP mail account with (open source) Linux tools

Updated Oct 2024. Originally posted the answer when the question was 'just' 7 years old, it is now ~10 years old. At the time I was looking for a solution to migrate off of Google Workspaces as they ...
Lockszmith's user avatar
7 votes

Backup and restore IMAP mail account with (open source) Linux tools

Try to use open source project imap-backup: https://github.com/joeyates/imap-backup $ imap-backup setup The setup system is a menu-driven command line application. It creates ~/.imap-backup ...
Quarind's user avatar
  • 257
7 votes

How can I create an image of a partition (ext4) and later mount it to browse/restore files?

e2image can be used to create an image of an ext4 file system, while only copying sectors which are in use: e2image -ra /dev/sda1 /path/to/file.img file.img will be created as a sparse file, so it ...
Stephen Kitt's user avatar
7 votes
Accepted

Copying or restoring crtime for files/directories on ext4fs filesystem

I've actually solved it on my own. You never know what you can do till you try :-) It must be safe to run even when all the filesystems are mounted read-write. #! /bin/bash dsk_src=/dev/sdc4 # ...
Artem S. Tashkinov's user avatar
7 votes
Accepted

Rollback root snapshot in BTRFS

What you have is a BTRFS filesystem with two subvolumes: fedora - This is set as your default subvolume, and is what you see when you mount the filesystem without specifying specifying a subvolume. ...
Emmanuel Rosa's user avatar
6 votes

How to restore permissions with BackInTime/rsync?

GNU chmod can take a reference file: --reference=RFILE use RFILE's mode instead of MODE values If the folder structure of your back remains the same, you could do something like: cd /path/to/backup ...
muru's user avatar
  • 75k
5 votes
Accepted

Restore a removed file when still in use

On Linux at least, you can access all files which a process still has open, in /proc/${pid}/fd: $ echo Test > removeme $ sleep 1200 < removeme & [1] 21954 $ rm removeme $ ls -l /proc/21954/...
Stephen Kitt's user avatar
5 votes
Accepted

How can I create an image of a partition (ext4) and later mount it to browse/restore files?

As root, just cat the partition to another partition: cat /dev/sdXn > /dev/sdYi or to a file: cat /dev/sdXn > backup.img Or to a file or partition on another machine: cat /dev/sdXn | ssh user@...
cas's user avatar
  • 79.5k
5 votes
Accepted

dd: "No space left" when restoring backup to exact same disk

It's possible for dd conv=sync,noerror (or dd conv=noerror,sync) to corrupt data in some cases. However in your case it's probably simply surplus zeroes at the end of file. If your device is not ...
frostschutz's user avatar
5 votes

Backup my EFI boot entry for easy restore

Rather than back up your firmware efi boot entry, just have the tools on hand to easily recover it. Usually windows doesn't delete your linux entry, but it may prioritize itself first. Modern ...
user10489's user avatar
  • 7,737
4 votes

Backup and restore IMAP mail account with (open source) Linux tools

OfflineIMAP is a GPLv2 software to dispose your mailbox(es) as a local Maildir(s). For example, this allows reading the mails while offline without the need for your mail reader (MUA) to support ...
Patrick Decat's user avatar
4 votes
Accepted

Backup and Restore a Debian system

This will work, in that you will be backing up all of your data - and I recommend it to back up your data. I personally use this method to back up several full systems in small environments (as well ...
Spooler's user avatar
  • 240
4 votes
Accepted

Tar incremental backup restore with one command

cat archive.*tar |tar xvf - -g /dev/null --ignore-zeros -C destination At the end of tar files, is the 'end-of-archive' marker (2x 512 blocks of zero bytes. Tar will continue to read past the marker ...
robbat2's user avatar
  • 3,658
4 votes
Accepted

Debian - Restore a Timezone File

The command you need is: apt-get install --reinstall tzdata Background To know which package contains the file you damaged, you could do a dlocate -S /usr/share/zoneinfo/America/Puerto_Rico or ...
telcoM's user avatar
  • 103k
3 votes

How to restore permissions with BackInTime/rsync?

We can get the list of files with the changed permissions by rsync -ani rsync -ani newFile new/ | awk {'print $2'} then we can pass the output to chmod and use the output for reference file from ...
Piyush Jain's user avatar
3 votes
Accepted

Can I restore a Macintosh disk image using dd?

Short answer: yes this works fine. Longer answer: I used dd to restore the data as above, and it was successful. However, the Mac wouldn't load the OS upon power-on. Picking the HDD from the startup ...
realityChemist's user avatar
3 votes
Accepted

How can I keep permissions on original files when restoring backups with Duplicity?

Duplicity can and does restore permissions and owner of your files/folders as they were before the backup. To restore the owner two prerequisites have to be met: The restore command has to be run as ...
ede-duply.net's user avatar
3 votes

Can I restore a single partition from a Clonezilla disk image?

I just had to restore a partition from one of my image backups. Steps: As my backup was to an external nfs drive, I booted of the clonezilla cd, start clonezilla select device image select ...
Chuck Amsler's user avatar
3 votes

Using rsync to create a complete OS backup/clone sufficient?

No, it won't work at all. You should send it to a mounted filesystem, so not /dev/[backup disk] but something like /mnt/[backup disk]/ after doing mount /dev/[backup disk] /mnt/[backup disk] ...
Garo's user avatar
  • 2,099
3 votes

Arch linux: restore session with running programs after running out of battery

First setup hibernation on arch, https://wiki.archlinux.org/index.php/Power_management/Suspend_and_hibernate#Hibernation Then create a udev rule to hibernate on low battery percentage, https://wiki....
pineappleFrenzy's user avatar
3 votes
Accepted

Backup and restore timestamps of files/directories?

If you have GNU find and Perl available, you could rig something up with them. The -printf action to find can print the timestamps, and Perl has the utime function to modify them. Or two, the builtin ...
ilkkachu's user avatar
  • 142k
2 votes

How to restore a DD image file in my primary disk on new debian server

You can SSH to your server, CAT your file into a pipe to GUNZIP after what you can pipe the uncompressed output to DD, which will then write the file to the disk of your choice. ssh user@host cat /...
user166213's user avatar
2 votes
Accepted

dd image too large to recover

Your image file is 40KB larger than the disk (976773248 - 976773168 sectors). It can't work to dd the whole image to the disk. I guess your dd command was showing some warnings like "no space left" or ...
rudimeier's user avatar
  • 10.5k
2 votes

restore after "git rm"

Since none of the files had been committed, they are now lost. Had they been committed, you would have recovered by issuing git reset --hard That would have restored the files removed (and reverted ...
Kusalananda's user avatar
  • 342k
2 votes

How could you possibly preserve file ownership in a backup (/etc)?

The way I do it is to install etckeeper. It is well integrated in Debian and derivatives. Etckeeper takes care of remembering permissions (but not SELinux labels). Backing up /etc is then reduced to ...
Gilles 'SO- stop being evil''s user avatar
2 votes
Accepted

Debian: I'm unable to log in + can't boot properly after system backup and restore

You've failed to restore the file ownerships and permissions for the OS files. I'm quite impressed the system boots and allows root to log in. If you took good backups you should be able to wipe and ...
Chris Davies's user avatar
2 votes
Accepted

How to restore GRUB after restoring Debian from backup?

You also need to mount /sys on to /mnt.
jdwolf's user avatar
  • 5,087

Only top scored, non community-wiki answers of a minimum length are eligible