Can't Stop Array: mdadm Not Getting Exclusive Access on Fedora Core OS
When using the mdadm version 4.3 on Fedora Core OS, you might encounter an issue while trying to stop an array using the command sudo mdadm --stop /dev/md127.
Issue Description
The error message displayed is:
mdadm: not getting exclusive access /dev/md127: Perhaps running process, mounted filesystem active volume group?
Understanding the mdadm Command
The mdadm command is used for managing and monitoring Linux Software RAID (Redundant Array of Independent Disks) arrays.
Exclusive Access and the Error Message
The error message mentioned above is typically caused by a process accessing the array, a mounted filesystem, or an active volume group. This prevents the mdadm command from gaining exclusive access to the array.
Possible Solution
In most cases, stopping the systemd service responsible for the array can help resolve this issue:
sudo systemctl stop mdraid.service
Additional Steps to Identify Conflicting Processes
If stopping the service does not solve the issue, you can look for conflicting processes:
fuser -v /dev/md127
The output from the above command can reveal processes utilizing the array. You can then stop these processes manually.
Inspecting Active Volume Groups
You can also check for active volume groups:
sudo vgs
If any active volume groups are found, consider deactivating or unmounting them:
sudo vgchange -a n <volume\_group\_name>
Re-trying the mdadm Command
After addressing potential conflicting processes, you can try running the mdadm --stop command again:
sudo mdadm --stop /dev/md127
- The issue preventing
mdadmfrom getting exclusive access to /dev/md127 can be caused by a running process, a mounted filesystem, or an active volume group. - Stopping or unmounting conflicting processes or volume groups can help resolve the issue.