I’m attempting to replace a legacy script that grows an xfs partition on a disk that now makes use of nvme based mostly drives. It makes use of
parted to take away and recreate the partition over all the disk. Which now mounts based mostly on disk
UUID reasonably than the machine title.
In my script under
$DISK evaluates to
$DEVICE_NAME evaluates to
#Take away the primary and solely partition parted -s $DEVICE_NAME rm 1 #Recreate the partition parted -s -a optimum $DEVICE_NAME mklabel gpt -- mkpart major xfs 1 -1 #Make filesystem on disk mkfs.xfs -f $DISK
/dev/nvme1n1p1: UUID="331b6037-193c-47e6-b0ab-2e8447b0fa1d" TYPE="xfs" PARTLABEL="major" PARTUUID="3304f5e6-8626-4f2a-aa95-3be9113e42f3" /dev/nvme1n1: PTTYPE="gpt"
As soon as the file system is made I can get the brand new
UUID=$(blkid -o worth -s UUID $DISK)
The script modifies the /and many others/fstab with these new values and runs
mount -a however doesn’t mount.
Fdisk reveals the file as a “Microsoft fundamental” Sort
Disk /dev/nvme1n1: 107.four GB, 107374182400 bytes, 209715200 sectors Items = sectors of 1 * 512 = 512 bytes Sector measurement (logical/bodily): 512 bytes / 512 bytes I/O measurement (minimal/optimum): 512 bytes / 512 bytes Disk label kind: gpt Disk identifier: XXXXX # Begin Finish Dimension Sort Identify 1 2048 209713151 100G Microsoft fundamental major WARNING: fdisk GPT assist is at present new, and subsequently in an experimental part. Use at your individual discretion.
/var/log/messages is exhibiting errors
Apr 7 03:45:14 xxx kernel: nvme1n1: p1 Apr 7 03:45:50 xxx kernel: XFS (nvme1n1p1): Mounting V5 Filesystem Apr 7 03:45:50 xxx kernel: XFS (nvme1n1p1): Ending clear mount Apr 7 03:45:50 xxx systemd: Unit svc.mount is certain to inactive unit dev-disk-byx2duuid-9f28c8aax2d4cc1x2d4e46x2d85a5x2d4e3a63ecda43.machine. Stopping, too. Apr 7 03:45:50 xxx systemd: Unmounting /svc... Apr 7 03:45:50 xxx kernel: XFS (nvme1n1p1): Unmounting Filesystem Apr 7 03:45:50 xxx systemd: Unmounted /svc.