mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-11 22:10:11 +01:00
fix(xfs): clearing the xfs log before generating UUID (#64)
xfs_admin command to generate the new UUID for the cloned volume fails without returning error if there is log available in the filesystem : ERROR: The filesystem has valuable metadata changes in a log that needs to be replayed. Mount the filesystem to replay the log, and unmount it before re-running xfs_admin. If you are unable to mount the filesystem, then use the xfs_repair -L option to destroy the log and attempt a repair. Note that destroying the log may cause corruption -- please attempt a mount of the filesystem before doing this. No UUID will be generated in this case and application can not mount the volume. Here mounting the filesystem to the temp location with "nouuid" mount option first so that it can replay the logs first and system is in clean state and then unmount it and after that generating the UUID with the xfs_admin command. Signed-off-by: Pawan <pawan@mayadata.io>
This commit is contained in:
parent
1ed9ce525c
commit
27517c6254
2 changed files with 91 additions and 8 deletions
|
|
@ -362,14 +362,7 @@ func CreateClone(vol *apis.ZFSVolume) error {
|
|||
}
|
||||
|
||||
if vol.Spec.FsType == "xfs" {
|
||||
// for mounting the cloned volume for xfs, a new UUID has to be generated
|
||||
device := ZFS_DEVPATH + volume
|
||||
cmd := exec.Command("xfs_admin", "-U", "generate", device)
|
||||
out, err := cmd.CombinedOutput()
|
||||
if err != nil {
|
||||
logrus.Errorf("zfspv: Clone XFS uuid generate failed error: %s", string(out))
|
||||
return err
|
||||
}
|
||||
return xfs_generate_uuid(volume)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue