Skip to content

Commit

Permalink
skip quotas for xfs
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 17, 2024
1 parent c822cd9 commit 2d912b7
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions install/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,27 @@ def installQuota(self,):
1, 0, os.EX_OSERR)

if self.edit_fstab('/', '/') == 0:
preFlightsChecks.stdOut("Quotas will not be abled as we are are failed to modify fstab file.")
preFlightsChecks.stdOut("Quotas will not be abled as we failed to modify fstab file.")
return 0


command = 'mount -o remount /'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)

command = 'mount -o remount /'
mResult = subprocess.run(command, capture_output=True, text=True, shell=True)
if mResult.returncode != 0:
fstab_path = '/etc/fstab'
backup_path = fstab_path + '.bak'
if os.path.exists(fstab_path):
os.remove(fstab_path)
shutil.copy(backup_path, fstab_path)

preFlightsChecks.stdOut("Re-mount failed, restoring original FSTab and existing quota setup.")
return 0



##

if self.distro == ubuntu:
Expand All @@ -183,7 +197,16 @@ def installQuota(self,):
return 0

command = 'mount -o remount /'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
mResult = subprocess.run(command, capture_output=True, text=True, shell=True)
if mResult.returncode != 0:
fstab_path = '/etc/fstab'
backup_path = fstab_path + '.bak'
if os.path.exists(fstab_path):
os.remove(fstab_path)
shutil.copy(backup_path, fstab_path)

preFlightsChecks.stdOut("Re-mount failed, restoring original FSTab and existing quota setup.")
return 0

command = 'quotacheck -ugm /'
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR)
Expand Down

0 comments on commit 2d912b7

Please sign in to comment.