[RFC 2/3] scripts to find eligible lv ext4 filesystems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



/sbin/online-fsck-all:

#!/bin/bash

types="ext2,ext3,ext4"

# Scrub any fs on lvm by creating a snapshot and fscking that.
lvs --noheadings 2> /dev/null | while read lv vg junk; do
	dev="/dev/${vg}/${lv}"
	blkid -p -n "${types}" "${dev}" > /dev/null 2>&1 || continue

	${DBG} systemctl start "online-fsck@${dev}" 2> /dev/null
	res=$?
	if [ "${res}" -eq 0 ] || [ "${res}" -eq 1 ]; then
		if [ "${res}" -gt 150 ]; then
			res="$((res - 150))"
		fi
		echo "Scrubbing ${dev} done, (err=${res})"
	else
		${DBG} /sbin/online-fsck "${dev}"
	fi
done

# Stupid journald bug where the process still has to exist for
# the last few messages to get tagged to the service...
test -n "${SERVICE_MODE}" && sleep 2

exit 0



[Index of Archives]     [Reiser Filesystem Development]     [Ceph FS]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite National Park]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]     [Linux Media]

  Powered by Linux