New answers tagged

0

Depending on the type of data, you could use /var/lib, or /var/tmp. From the Filesystem Hierarchy Standard 3.0: /var/lib: This hierarchy holds state information pertaining to an application or the system. State information is data that programs modify while they run, and that pertains to one specific host. [...] State information should ...


0

For NTFS check this thread for details. Summary: sudo ntfslabel --new-half-serial /dev/sdXN


2

I guess what you are looking for is realpath: $ realpath --relative-to="$PWD" "foo/bar/../baz" foo/baz it also works fine with symlinks, use -s to ignore them: -s, --strip, --no-symlinks don't expand symlinks


0

It was suggested that I run find /home/$username/Documents -type l -exec ls -l {} \; which provided this output: lrwxrwxrwx 1 sonar sonar 18 Nov 21 06:03 /home/$username/Documents -> /home/$username/Documents Turns out the Documents folder was symlinked to itself. Running unlink Documents completely resolved the issue and allowed me to access my ...


1

The 2 in front of 775 is the setgid or "group id". What is setgid (set group ID) bit used for? The setgid affects both files as well as directories. When setgid permission is applied to a directory, files that were created in this directory belong to the group to which the directory belongs. Any user who has write and execute permissions in the directory ...


1

Cloning If your new card is at least as big as the old card (not one single byte smaller), cloning from the old card to an image file, and cloning from the image file to the new card should work. Crude cloning tools You can do it with cat or cp or pv or dd in a crude and risky way. It should work, but you had better double-check to avoid spelling errors ...


4

This manpage might clarify things a bit. What I read between the lines is that every filesystem implementation has to provide a sync-method. So the sync command just calls the Kernel, which in turn calls all sync-methods - propably for all mounted filesystems. Perhaps you can find better explanations of what is happening there when looking into the kernel-...


3

I would suggest to use ACL (access control lists) in this case. It allows much more finegrained control than just user/group permissions. See https://linuxconfig.org/how-to-manage-acls-on-linux for an introduction.


0

Someone recommended a sync command, which would have made the system flush all caches, and then avoid unfinished disk business. But this strange bug disappeared. My guess : syntax quirk on my part, not detected. Nevertheless, thanks for your help, and here what it looks like now : #!/bin/bash clear mapfile -t tab < <(jq -r '.[] | .' ...


0

Generally speaking, either you open the rights of the specific folders like 660 Either each of them belong to a specific group that can access to specific folders example : if folder2 belongs to apache you can do a usermod -a -G apache bar to allow him to access to this folder but at this moment you have to double-check if it's not too much permissive ...


1

Following your four steps (ignoring the "get the list..." steps as they are not needed): #!/bin/bash topdir=some/directory/path find "$topdir" -type f -name '*.gif' -exec sh -c ' for gifpath do convert "$gifpath" "${gifpath%.gif}.png" done' sh {} + find "$topdir" -type f -name '*.png' -exec optipng {} \; This would first find all regular ...


4

To make the space available, you need to use the xfs_growfs command as the filesystem on your logical volume is xfs. xfs_growfs / If it were ext2, ext3, or ext4, then you'd use resize2fs with the name. EDIT: It appears to have been changed in its latest release for Fedora and RHEL 8 and CentOS 8. Using the lv/block device works in RHEL 7 and CentOS 7 but ...


0

Stephen Kitt's answer is basically the right approach, but it should be done using mv rather than cp - there's no need to spend several minutes or hours copying all the files, when moving them will take almost no time at all. For example: logout as your user (ALL login instances, including any ssh sessions) and login as root. If your system is configured ...


0

So, I have managed to do it myself, these are the steps (for an MBR dirk): First of all, you need to change the UUIDs of the inner, encrypted filesystems, per partition. Decrypt /dev/sdX# using VeraCrypt and don't mount it, you'll get a device named /dev/mapper/veracrypt1 Use blkid to find the UUID of `/dev/mapper/veracrypt1' Edit /dev/mapper/veracrypt1 ...


1

Sounds like you want a hard link ln sourcefile /some/git/repo/targetfile Only any good if the source and target locations are within the same file system. Otherwise you’ll have to settle for a copy or a symlink. A symlink is a reference to a file. A hard link is another name for an existing inode. There are numerous resources on the web that explain in ...


0

the correct order is cryptsetup luksOpen /dev/sdb1 mydata which will open luks formated device. (you have to enter password for device) mount /dev/mapper/mydata /mydata which will maps device to /mydata. It might be a good idea to use different name (e.g. ) sudo cryptsetup luksOpen /dev/sda3 secure sudo mount /dev/mapper/secure /home_secure lsblk will ...


0

You're trying to mount the wrong device. cryptsetup luksOpen /dev/sdb1 mydata With this, /dev/sdb1 is your encrypted LUKS device, and /dev/mapper/mydata is the decrypted contents. mount /dev/sdb1 /mydata This fails because you can't mount a LUKS device. LUKS is not a filesystem. You have to mount the decrypted one: mount /dev/mapper/mydata /mydata ...


2

As mentioned in the other answer, if you can easily recreate the directory, then this can be done without shutting the system down. In other cases, where the number or size of files in the directory tree make it harder to just copy them to a new directory, you can also unmount the filesystem (or boot from a rescue disk if it is the root filesystem) and run ...


7

As mentioned in the comments, your home directory itself is huge, and won’t shrink again. Scanning your home directory’s contents will involve reading a lot of data, every single time (from cache or disk). To fix this, you need to re-create your home directory: log out, log in as root, and make sure no running process refers to your home directory: lsof /...


0

If you have the ability to restart the process then start it with strace and monitor the inotify_add_watch systemcall. inotify does not support recursive watches so each single directory that is watched will be printed to your screen. strace -fe trace=inotify_add_watch ./NewRelic


0

UUID is not always visible, (specially in VM env) I suggest to create a partition table and use PARTUUID after you are able to list the desidered partition lsblk --ascii -o NAME,PARTUUID,LABEL,PATH,FSTYPE zpool create pool02 /dev/disk/by-partuuid/c8e0c300-5ec9-714c-aef9-fa0dc3f0cab6 there no performance penalties when partition table against entire raw ...


0

The file /etc/fstab is intended for this very purpose. A script is not required. Prerequisites for the server: the /etc/hosts file must contain the IP FQDN & (short) hostname of your local server, and the remote server. Your local server should be the first line after the loopback(s): 127.0.0.1 [IPv4 loopback stuff] ::1 [IPv6 loopback stuff] 10....


1

Why not just place the mount in /etc/fstab, since you're RHEL 7. There are number of different configurations you can follow which, when your host is rebooted, will make sure your mount comes up with the machine, using _netdev and auto flags should take care of your use cases. fstab fstab man page You'll be using mount with a newly edited /etc/fstab.


3

As Christopher points out this question is very similar to Why is a text file taking up at least 4kB even when there's just one byte of text in it? I'm not sure if I personally class it as a duplicate or not. But where does this 1KB come from This is more commonly 4KB File systems are allocated in blocks of bytes (AKA allocation units) not ...


0

The average space used for a single file in the file system in your example is 4200 bytes. The average size of a file in your example is 800 bytes, since the file overhead in a tar archive is 512 bytes. Your claim could be true in case that many files are smaller than 800 bytes and some files are a bit larger than 4096 bytes and the filesystem uses an ...


3

ls’s -u option can be used to list files with their last access time (instead of the default last modification time): ls -lu Since you’re trying to examine large amounts of files, the recursive option could be useful: ls -luR You can also list all files accessed in the last two days using find: find . -atime -2 and multiple specifiers can be combined ...


Top 50 recent answers are included