Tag Info

Hot answers tagged

6

There's a reason all those utilities use recursive directory traversal to discover changed files. There isn't any better way. Inotify exists, but does AFAIK not scale to several thousand directories. Not only that, but you have to listen continuously (say, as a daemon) and if you miss a single update then you have to recheck everything. Ain't there ...


5

When on Linux you can use the inotify mechanism in combination with incron. Setup incron by installing the package and edit the config: /etc/incron.conf system_table_dir=/etc/incron.d user_table_dir=/var/spool/incron allowed_users=/etc/incron.allow denied_users=/etc/incron.deny lockfile_dir=/var/run logfile_name=incrond editor=vi Then configure a watch in ...


3

Annoyingly, btrfs filesystem show returns an approximate value if the size isn't a multiple of 1MB. It also requires a loop device, btrfs filesystem show img.btrfs doesn't work (as of Debian jessie). I can't find another btrfs subcommand that would help. But file img.btrfs helpfully returns the desired size. $ truncate -s 16684k /tmp/img.btrfs $ ...


3

The three block devices are logical volumes in an LVM volume group, fedora. swap is used for swap (spill-over for RAM), home is used to store all your personal data, and root is used for everything else (programs, system configuration, system logs...). There are good reasons for these three devices to be separate: swap works better as a separate block ...


3

Symbolic link files take more space. Hard linked files share the same inode; but a symbolic file is a pointer to the original (location). Despite that, there are two caveats for hard links: Not all file system support hard links. Hard links cannot be applied for folders. I guess you do not need to consider about the storage issue since in most of the ...


3

I think that most of your questions can be answered simply by remembering that in Btrfs, a snapshot is not really special, it's just a Btrfs subvolume. It just happens that when it's created, it has initial contents instead of being empty, and the storage space for those initial contents is shared with whatever subvolume the snapshot came from. A snapshot ...


3

You can access the disk image and its individual partitions via the loopback feature. You have already discovered that some disk utilities will operate (reasonably) happily on disk images. However, mkfs is not one of them (but strangely mount is). Here is output from fdisk -lu binary.img: Disk binary.img: 400 MiB, 419430400 bytes, 819200 sectors Units: ...


2

SSHFS doesn't implement the inotify API. Making that work would require a fundamental redesign for two reasons: SSHFS uses SFTP to communicate with the server. The SFTP protocol has no facility to be notified of file changes on the server side. The server might not even have a file change notification mechanism — this could be made an optional feature of ...


2

Snapshots, like all btrfs subvolumes, have a path. If you mount the parent subvolume, you can see them all, and interact with them. So you can easily chroot to as many different snapshots as you'd like.


2

As this is a executable script, it is good to place it at /usr/bin or /usr/local/bin Advantage: avoid typing full path of the script like /var/opt/anything/my_script ever you want to test it from terminal , just type my_script I think there is no standard of doing this, place it anywhere (obviously not at /dev, /proc, /sys, /var/www, etc.) you like, ...


2

Startup scripts and assets are usually put in the user's home directory. (The home directory can either be found by getent passwd username or by logging in as the user and inspecting the value of $HOME.)


2

Assuming a dedicated zfs file system was created for that user, you should be able to delete it with: zfs destroy rpool/export/home/user


2

The difference is negligible and irrelevant. Creating a hard link or a symbolic link only takes up a few bytes. A hard link costs one directory entry: space to store the name and the inode number in the directory. A symbolic link also costs one directory entry, plus space to store some metadata about the symbolic link; depending on the filesystem, this ...


1

Hugo Mills provided an answer on the btrfs mailing-list: Basically "single" mode distributes 1GiB chunks, which is good enough for my use case.


1

How do I configure a data scrubbing daemon that automatically detects when I randomly lose a HDD sector causing an archive to not pass it's checksum verification, then to copy a backup onto another sector. It's built in to Btrfs. Try: btrfs scrub start It has never yet happened to me that an error was found, but I expect that if one is found then: ...


1

The -b option in tar was used to control the block size tar writes to a device, so that is exactly what you want. But -b 512 regarding the manual page tar(1) means a block size of 512*512 = 262144. All block sizes are valid that your device, you write the tar output to, can handle. In history this was needed for different tape drives the tar command was ...


1

Both btrfs filesystem show and btrfs filesystem usage give you the size of the device, in Mebibytes, Gibibytes, or other powers of 2. You can just pass this on to truncate with the suffix M or G etc as these are also in powers of 2 (do not use suffix MB GB!). For example, on a 1G image reduced by 10M: sudo btrfs fi show /mnt devid 1 size 1014.00MiB used ...


1

find . -type d -size +4096c Would report those directories larger than 4kiBs. It's the same as for regular files. For most file systems, directories (think of them as phone directories, a list of mappings between number and name, not folders) are exactly like regular files, it's just that their content has a specific format and is treated specially and ...


1

There is another way to do this in general, use kpartx (not kde related) sudo kpartx -a binary.img and now you should have all partition devices defined under /dev/mapper as loop0p1, loop0p2, ... and then sudo mkfs.ext4 /dev/mapper/loop0p1 Optionnaly, when you are done, you can run also sudo kpartx -d binary.img to get rid of the loop0p? deivce


1

I don't know why it looks for binary.img1 (… and later for binary.img2 buried in the commentary.) That is because the tools are expecting the filenames to follow a specific pattern. That pattern is the one used by device files for actual discs and disc volumes on your system, namely: A device file encompassing the whole disc is named sda (or ...


1

My current thought of btrfs is that operates pretty much like git, … It doesn't. Snapshots work more like cp -a /path/to/source /path/to/snapshot, except that they share data, and taking a snapshot is fast. But that data is copy-on-write; if you write to the file, the part you wrote to is no longer shared. (Note cp has --reflink option that, on btrfs, ...


1

You cannot detect or create such files in general. They only exist because a filesystem is reporting inconsistent data. In the absence of modifications to the filesystem, there are redundancies between various ways of obtaining information about the files on that filesystem. For example, permissions permitting: If a file name is reported by readdir then ...


1

The replace command doesn't make a backup of sda1, it replaces sda1 with sdb1 in the filesystem, but since it's a one device filesystem and btrfs doesn't bother wiping the data from sda1 when it replaces it they end up being indentical copies of the filesystem. However you do NOT want to do this as both will have the same UUID, and currently it's not safe to ...


1

I successfully achieved converting MBR to GPT, but used two extra (new) disks for safety reasons. Note that I'm using Debian in combination with the GRUB bootloader. With my setup, which simply has a Linux partition and a swap partition, the procedure is roughly as following. First, make a full backup: use the first extra disk to make a full backup of ...



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