Hot answers tagged

3

The MBR IS 512 bytes. So the first example is how you would back it up. The partition table is at the end, in the area after 440 bytes in - so, if you wanted to back it up WITHOUT the partition table, then you could use the second example (why you'd want that, I don't know).


2

The MBR (Master Boot Record) is 512 bytes. 446 bytes Bootloader 64 bytes (4 * 16 bytes) Partition Tables 2 bytes Magic Number which is AA55H However these values are for generic MBR, you can see other MBR structures from: https://en.wikipedia.org/wiki/Master_boot_record Anyway you have to backup hole 512 bytes of MBR with dd (disk-to-disk) command.


2

Checkout ntfsclone. I believe that's what you're looking for. From the man page: ntfsclone will efficiently clone (copy, save, backup, restore) or rescue an NTFS filesystem to a sparse file, image, device (partition) or standard output. It works at disk sector level and copies only the used data. Unused disk space becomes zero (cloning to sparse ...


2

I don't agree with the squashfs recommendations. You don't usually write a squashfs to a raw block device; think of it as an easily-readable tar archive. That means you would still need an underlaying filesystem. ext2 has several severe limitations that limit its usefulness today; I would therefore recommend ext4. Since this is meant for archiving, you ...


2

SquashFS is a compressible read-only filesystem that fits your requirements well, has been in the kernel for a few years, and is already widely used (e.g., in LiveCDs). The latest documentation for the userspace tools is on GitHub. From the documentation: Squashfs is a highly compressed read-only filesystem for Linux. It uses either gzip/xz/lzo/lz4 ...


2

It would generally avoid all the sudo and deliberately inhibiting yourself access to your files - it will likely cause you problems and possibly be so annoying you will just override your own protection mechanisms anyway. I would instead use trash-cli which behaves like a desktop type trashcan where you can recover your file later if you make a mistake. ...


2

There are several reasons why this may have failed: /var/www/html could actually be a symlink to somewhere else in your filesystem (try ls -la /var/www/ to see if there is a line like html -> /foo/bar/html. If /dev/sda3 was mounted during either of your dd processes, the filesystem may have been corrupted so that you don't see that file any more. Using ...


1

I don't know anything about BackupNinja but if it (like most backup programs) can write to stdout then you can do something like this: echo foo | su -g users nobody bash -c 'umask 177; cat >/tmp/newfile' ls -l /tmp/newfile -rw------- 1 nobody users 4 4. Feb 09:39 /tmp/newfile


1

if you want to backup your home directory, then you need not necessarily to be in recovery mode. That would only be needed if you want a complete snapshot of your system disk. Just don't change files in the home directory while the backup is running. Try this: xorriso -for_backup -outdev /dev/sr0 -blank as_needed -map "$HOME" / Have a nice day :) ...


1

You'd probably be better served by a compressed filesystem. There are ways of compressing various Linux filesystems (FUSE can do it), but since this will be read-only once you've created it, you might consider squashfs. You create the filesystem with mksquashfs. Linux has had squashfs in the main kernel since 2.6.something, so it should work from pretty ...


1

If you remove the 'w' bit, you can't accidentally overwrite whatever you removed the 'w' bit from. If that's a directory, that means you can't add or remove files from that directory; if that's a file, that means you can't change the file. Downside of that method, however, is that you lose data (IMO, file permissions are part of your backup data). An ...


1

You need to treat /dev/sdb2 as either a raw partition or as a filesystem, not as both. It appears as though you created a filesystem on it at one point and mounted it at /media/ravi, but as soon as you piped tar or cpio output directly to /dev/sdb2, you ruined the filesystem. Either write to a file on the filesystem, or treat it as a raw device that you do ...


1

Max size of MBR is 512 bytes. Back to old days MBR was used to load kernel into memory and to bootstrap it. Nowadays MBR used to bootstrap bootloaders, then bootloaders bootstraping kernel. More about MBR you can find in wikipedia or osdev wiki.



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