lvcreate gives the following error about semaphore. lvcreate -n test_lv10 -L 1G test_vg_3 Found duplicate PV XfbmuZ2c2MPAb8r0TDIBNrcyUx0yMZpu: using /dev/emcpowerh not /dev/sdb Failed to create notification semaphore: Invalid argument Unable to resume test_vg_3-test_lv10 (253:3) Failed to activate new LV. Failed to create notification semaphore: Invalid argument Unable to deactivate test_vg_3-test_lv10 (253:3) Unable to deactivate failed new …
Author: Albert
How to create LVM snapshot for system maintenance?
This article shows step-by-step instructions for getting a CentOS system ready and making LVM snapshots for system maintenance or software upgrades. LVM snapshots are meant to be used as a restoration point if anything goes wrong during the upgrade process. The suggestion is to run this procedure in a test environment first. Also, one of …
How to shrink an LVM Logical Volume
Since shrinking is not supported on these file systems, you cannot reduce the size of a logical volume that houses a GFS2 or XFS file system. The lvreduce command typically warns about potential data loss and requests confirmation. In some circumstances, such as when the logical volume is inactive, or the —resizefs option is not …
How to convert a standard partitioned system to LVM?
When you add a new device to the server, you need to partition it up. You only need two of them. This will make a 1GB device for /boot and use the rest for LVM. # fdisk /dev/<new_dev> Command: n Primary?: p Number: 1 Start: <enter> End: 1G Command: n Primary?: p Number: 2 Start: …
How to delete a non-root LVM volume?
If the non-root LVM volume, Volume Group, and Physical Volume used for the LV is no longer needed on the system, they can be deleted using the steps below. If the LVM volume has any critical data, make sure to make a copy of that data before moving on to the following steps. Replace /dev/sdc1 …
How to create LVM in CentOS, AlmaLinux, and RockyLinux?
An LVM is a tool for managing logical volumes. It can assign disks, stripes, mirrors, and change the size of logical volumes. With LVM, a hard drive or set of hard drives is assigned to one or more physical volumes. LVM physical volumes can be put on other block devices, which could include two or …
How to manually destroy an LVM volume in a Linux server?
Use the ‘dd’ command to delete the first few sectors of the physical volume, especially the first four. This will eliminate the disk’s lvm labels, which are used to figure out that the disk is a lvm disk. # dd if=/dev/zero of=/dev/sd<X><Y> bs=512 count=10 Please remember that this would make the partition useless, so a …
Reduce the size of a non-root LVM and allocate that space to the root LVM?
Using the command df <MOUNTPOINT>, find the path to the LVM logical volume device node file (LV_PATH) for the specific filesystem mount point, for instance. df /home Unmount the filesystem (necessitates stopping all access to the filesystem, e.g., for /home, all users will need to log out) Fsck the filesystem Shrink the filesystem Shrink the …
Why ansible module fails to find file on a remote source that matches a ‘with_file_glob’ attribute
To resolve this issue, create the file list in another task, or use a shell or command module to execute a copy command. Local evaluation is performed on the with_file_glob attribute. When a path to a remote source is desired, the file glob expansion will be invalid. This issue applies whenever a remote source is …
Is there an easy way to change the permission of /var/log/cups to 644 and be persistent?
To change the permissions for the CUPS log files (access log, page log, and error log), add or change the LogFilePerm directive in /etc/cups/cupsd.conf (CentOS 6 and earlier) or /etc/cups/cups/cups-files.conf (CentOS 7 and later) to the desired numeric permissions. For instance, to let anyone read the log file, set. LogFilePerm 0644 Restart the CUPS service …
A file cannot be copied, read, written, or removed even by root
The root cannot write to or read from regular files even with those specified permissions. # cp the.file /tmp/the.file.bk cp: cannot open ‘the.file’ for reading: Permission denied # lsattr the.file lsattr: Permission denied While reading flags on the.file # rm -rf the.file rm: cannot remove ‘the.file’: Permission denied # file the.file the.file: regular file, no …
How to change default permission of /var/log/messages
It is best to only change $umask once and use $FileCreateMode instead to change the mode. Add the $umask near the top of the configuration file, such as at the top of the GLOBAL DIRECTIVES section of /etc/rsyslog.conf. Make sure it is set before any $IncludeConfig directives. Use $umask 0022 to stop files from being …
Is it okay to change the permissions of files and folders inside /proc
The files in /proc directory are world-writable in CentOS. What are the effects of these permissions on the security of the Linux server? Is it ok to change their world-writable permissions? Executing the following command lists world writeable files. find / -type f -perm -002 -ls | more The files in the /proc directory are …
Is it safe to change the default permission of /var/log/btmp
Failed login attempts are logged in /var/log/btmp file. For security reasons, it is recommended to set default permission 0600 on the /var/log/btmp file. Secondly, the file should be owned by the root user. Some services like sshd do not work, if the default permission of the file is changed. The following error may be observed …
Could not change permission for files under /boot/efi in CentOS 6, 7, 8
The vfat filesystem used by /boot/efi is the cause. Despite not having the concept of permissions itself, the vfat filesystem can be mounted under Linux with any set of permissions. Unable change permission for /boot/efi/EFI/centos/grub.conf on CentOS 6 as shown below. [root@centos6 centos]# ls -ltr total 248 -rwx------ 1 root root 247570 Jan 22 2011 …