mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
scylla_raid_setup: wipe filesystem signatures from specified disks
The discussion on the thread says, when we reformat a volume with another
filesystem, kernel and libblkid may skip to populate /dev/disk/by-* since it
detected two filesystem signatures, because mkfs.xxx did not cleared previous
filesystem signature.
To avoid this, we need to run wipefs before running mkfs.
Note that this runs wipefs twice, for target disks and also for RAID device.
wipefs for RAID device is needed since wipefs on disks doesn't clear filesystem signatures on /dev/mdX (we may see previous filesystem signature on /dev/mdX when we construct RAID volume multiple time on same disks).
Also dropped -f option from mkfs.xfs, it will check wipefs is working as we
expected.
Fixes #13737
Signed-off-by: Takuya ASADA <syuu@scylladb.com>
Closes #13738
(cherry picked from commit fdceda20cc)
This commit is contained in:
committed by
Botond Dénes
parent
488d36f77e
commit
a58323766b
5
dist/common/scripts/scylla_raid_setup
vendored
5
dist/common/scripts/scylla_raid_setup
vendored
@@ -125,9 +125,12 @@ if __name__ == '__main__':
|
||||
procs.append(proc)
|
||||
for proc in procs:
|
||||
proc.wait()
|
||||
for disk in disks:
|
||||
run(f'wipefs -a {disk}', shell=True, check=True)
|
||||
if raid:
|
||||
run('udevadm settle', shell=True, check=True)
|
||||
run('mdadm --create --verbose --force --run {raid} --level={level} -c1024 --raid-devices={nr_disk} {disks}'.format(raid=fsdev, level=args.raid_level, nr_disk=len(disks), disks=args.disks.replace(',', ' ')), shell=True, check=True)
|
||||
run(f'wipefs -a {fsdev}', shell=True, check=True)
|
||||
run('udevadm settle', shell=True, check=True)
|
||||
|
||||
major_minor = os.stat(fsdev).st_rdev
|
||||
@@ -138,7 +141,7 @@ if __name__ == '__main__':
|
||||
# and it also cannot be smaller than the sector size.
|
||||
block_size = max(1024, sector_size)
|
||||
run('udevadm settle', shell=True, check=True)
|
||||
run(f'mkfs.xfs -b size={block_size} {fsdev} -f -K', shell=True, check=True)
|
||||
run(f'mkfs.xfs -b size={block_size} {fsdev} -K', shell=True, check=True)
|
||||
run('udevadm settle', shell=True, check=True)
|
||||
|
||||
if is_debian_variant():
|
||||
|
||||
Reference in New Issue
Block a user