Tag Info

New answers tagged

0

I am pretty sure, you won't get around btrfs-send/btrfs-receive. Another option would be, to copy the subvolumes and then deduplicate them on the destination, but this would take ages. For the readonly problem: as these are daily snapshots, arent most of the volumes read-only anyway? I would do a $btrfs subvolume create /subvolumeA/source $for i in ...


0

I will just provide a short answer because I think this is being overthought. If you read the main kernel wiki about the btrfs (sub-)commands, you will find that there are two commands for making a backup and restore. Just in case, this means that it is not designed to be a backup, but to be an snapshot filesystem, with the idea of rolling back if needed, ...


0

First, concerning the read permission for Others on /hello, you probably want either no read permission at all, or you want Read and Execute permission on /hello. Execute permission on a directory means the user can do an ls in the directory. Read without Exec permission means that the other user would be able to read any file in that directory, but only if ...


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

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 ...


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 ...


1

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


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 ...


0

I install Android to USB with the .iso file and a USB boot maker program (rufus). There are 2 ways: use 2 USB and use 1 USB only. 2 USB: reboot computer > boot with USB > open Install to harddisk > push in the second USB > re detect > ... 1 USB: you will need Acronis to split the USB after make a USB boot My USB is 2GB. After make it bootable, I split to ...


0

Since you didn't specify if actually corrupting the FS is acceptable you may want to look at this Q&A: http://serverfault.com/questions/40302/how-to-corrupt-a-file-system :) Note: you'd need to corrupt the root filesystem or a swap partition to cause the system to panic, a regular non-critical partition will be just switched to readonly mode but the ...


0

UI front-end for locate command that works almost the same as Everything : https://github.com/AlexTuduran/Locator/releases


1

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.)


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 ...


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 ...


0

The easiest way to do this using a UI that will guide you through the process is GParted, otherwise you could delete/modify partitions with fdisk in the command line.


0

You can use lsblk command as well. Also, if you want to know things in detail: df -T (file system type) df -h (Humana readable format) For your question mount -l is the answer as others said :)


0

df $(dirname/your/destination/directory/filename) The basename is used in case the filename does not already exist. The directory should already exist. If it doesn't keep taking the basename until it does.


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 ...


0

Here is a ZFS image created with: truncate -s 64M pool losetup /dev/loop0 pool zpool create test-pool /dev/loop0 echo test > /test-pool/test-file.txt zpool export test-pool bzip2 -9 pool Which is probably the smallest you can get. Here uuencoded: begin 644 pool.bz2 M0EIH.3%!629365I`^4$``HG_____________________________________ ...


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


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: ...


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

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 ...


0

Solved it: became the owner of the filesystem by adding the uid option (you can find you uid on /etc/passwd) and made the filesystem executable by using nrfs-3g (had to install it): /dev/sda1 /run/media/luancristian/Dados ntfs-3g defaults,uid=1000 0 0


0

I am using duplicity with OpenStack-Storage. It also features encryption (symmetric and PGP) and incremental backups. Available for download at http://duplicity.nongnu.org/ or installable via apt-get. My thoughts of duplicity are, that it is quite actively developed and has a huge range of possible storage adapters, so that you should be able to easily fit ...


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.


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 ...


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, ...


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 ...


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 ...


0

You should probably make use of 'strace' &/or 'truss'. Both tools can be used to examine file system operations when a program is ran or running. For example: $ strace -pf $(ps af | grep "firefox" | grep -v "grep" | awk '{print $1}') That command will bind to the process id obtained from 'ps' and follow any child threads it may use.


3

stat -f /dev/mapper/fedora_12345-root returns information about the filesystem containing the device node, which is /dev. To return information about a mounted filesystem, you need to look at a file on that filesystem: stat -f /. The df utility automatically translates mounted block devices to a mount point for them, but stat doesn't do this.


0

I would argue that "file type" is not even a meaningful concept under Unix; In good old days of mainframe commputers their OS's supported several file types including sequential and index-sequential. Modern operating systems (Un*x and arguably Windows) reduce the set of the file types to a minimum (including executable, shared object). It may ...


0

The automountd is a root process, so you could not have killed it. Now if you continued to work, there is a good chance that the old NFS-server was still up and running for a while. Ask your IT-team wether they can rsync newer files from the old server to the new server for your home-directory.


3

Short answer: Ext4 is the standard file system on most Linux distribution. It works, it is safe, and as @Marco said: If ext4 works for you, just keep using it Choosing a file system It depends on what are your objectives. For a total compatibility across systems, you may choose FAT32 (do not blame me - I think it's a terrible choice). NTFS works ...


1

Larger inodes are useful if you have many files with a large amount of metadata. The smallest inode size has room for classical metadata: permissions, timestamps, etc., as well as the address of a few blocks for regular files, or the target of short symbolic links. Larger inodes can store extended attributes such as access control lists and SELinux contexts. ...


0

There are two basic ways to check whether two files are the same. The first one is to check whether their paths are the same. This has no false positives, but plenty of false negatives. An obvious case of false negatives is if symbolic links are involved. You can handle that case by resolving the symbolic links. For existing directories that you have the ...


4

The system doesn't know whether a file is binary or text. In all (AFAIK) Unix-type operating systems, fopen(path, "rb") is exactly the same as fopen(path "r") - the b has no effect. It's accepted because standard C needs to be portable to some other OSes that do make such a distinction.


2

Endless probabilities here. Stale file will last a long as there is a program using that file/directory. Depends on how you 'start' work every day, how network is organized. One issue I see directly in your question is that 'killall -u user' wouldn't certainly kill all user processes. You should use (in bash) 'killall -9 -u user & disown' and check that ...


17

Often, it doesn't care. You just pass it to a program and either it interprets it or it doesn't. It may not be useful to open a .jpg in a text editor, but you're not prevented from doing this. The extension, like the rest of the filename, is for the organisational convenience of humans. It may also be possible to construct files that can be validly ...


68

The file utillity determines the filetype over 3 ways: First the filesystem tests: Within those tests one of the stat family system calls is invoked on the file. This returns the different unix file types: regular file, directory, link, character device, block device, named pipe or a socket. Depending on that, the magic tests are made. The magic tests are ...


7

The first thing to check is the hard-coded file type that is recognized by the kernel. These are the file types such as directory, character-special file, block-special file, pipe-special file, socket, and symbolic link. This information comes from the inode of the file. If the file is a plain file, the next set of information comes from the first 256 ...


4

The file command applies some heuristics from inspecting (parts of) the file and making a qualified guess. Beyond that there are some special cases where additional information can be obtained; like the #! at the beginning of a text file, a BoM (byte order mark), or specific header bytes of executable file formats. The #! and binary marks in executables are ...


12

That information is commonly found in the header of the file. The file command analyzes the target and tells you information about the file. A lot of information is often derived from file headers which are often times the first few bytes of a file (see below). Headers are used by the system to figure out how to handle files. #!/bin/bash at the beginning ...


3

Change directory to each one in turn and look at the output of pwd -P. With the -P flag, pwd will display the physical current working directory with all symbolic links resolved.


1

20% disk usage vs. 15% inode usage is not too bad. 20% disk usage vs. 100% inode usage would be a problem. The question is, will you reach 100% inode usage before 100% disk usage. That's when you need more inodes. It very much depends on the way you use your filesystem. For example if it's a partition that only holds photos or videos or similar files of ...


0

Each file is guaranteed to consume at least 1 inode, and more if the files get sufficiently large. In theory, if your partition is going to be made up of lots of large files, you need fewer inodes. Fewer inodes means more disk space for data. Particular applications are partitions for databases in which the database holds most of the data in several large ...



Top 50 recent answers are included