{"id":1360,"date":"2025-12-04T13:12:01","date_gmt":"2025-12-04T12:12:01","guid":{"rendered":"https:\/\/ndk.sytes.net\/wordpress\/?p=1360"},"modified":"2025-12-04T13:12:40","modified_gmt":"2025-12-04T12:12:40","slug":"enable-ext4-quotas-on-root-partition","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=1360","title":{"rendered":"Enable EXT4 quotas on root partition"},"content":{"rendered":"\n<p>Enabling quota handled by EXT4 on a root partition is not doable as it needs the device to be unmounted and can only be done if booted from a live disk or alike&#8230; Yeah whoever took that decision needs to be punished. I found a script which tunes the FS before it is getting mounted at boot time. Here the script:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#!\/bin\/bash\n\n\ncat &gt; \/etc\/initramfs-tools\/scripts\/init-premount\/ext4_quota &lt;&lt;\"EOF\"\n#!\/bin\/sh\n\nPREREQ=\"\"\n\nprereqs() {\n    echo \"$PREREQ\"\n}\n\ncase \"$1\" in\n    prereqs)\n        prereqs\n        exit 0\n        ;;\nesac\n\n\n\/sbin\/tune2fs -l \"${ROOT}\" | grep -q features || (echo \"no ext4 found in ${ROOT}\"; exit 0)\necho \"Enabling ext4 quota on ${ROOT} \"\n\/sbin\/tune2fs -O quota \"$ROOT\" || echo \"tune2fs: $?\"\nEOF\n\nchmod 0755 \/etc\/initramfs-tools\/scripts\/init-premount\/ext4_quota\n\ncat &gt;\/etc\/initramfs-tools\/hooks\/tune2fs &lt;&lt;\"EOF\"\n#!\/bin\/sh\n\nPREREQ=\"\"\n\nprereqs() {\n    echo \"$PREREQ\"\n}\n\ncase \"$1\" in\n    prereqs)\n        prereqs\n        exit 0\n        ;;\nesac\n\n. \/usr\/share\/initramfs-tools\/hook-functions\ncopy_exec \/sbin\/tune2fs \/sbin\nEOF\n\nchmod 0755 \/etc\/initramfs-tools\/hooks\/tune2fs\n\nupdate-initramfs -k all -u\nrm -v \/etc\/initramfs-tools\/scripts\/init-premount\/ext4_quota \/etc\/initramfs-tools\/hooks\/tune2fs<\/pre>\n\n\n\n<p>I found the script over here:<\/p>\n\n\n\n<p><a href=\"https:\/\/anton.dollmaier.name\/2024\/10\/enable-native-filesystem-quotas-in-ext4\">https:\/\/anton.dollmaier.name\/2024\/10\/enable-native-filesystem-quotas-in-ext4<\/a><\/p>\n\n\n\n<p>Thank you a ton dear Anton!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Enabling quota handled by EXT4 on a root partition is not doable as it needs the device to be unmounted and can only be done if booted from a live disk or alike&#8230; Yeah whoever took that decision needs to be punished. I found a script which tunes the FS before it is getting mounted [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1360","post","type-post","status-publish","format-standard","hentry","category-linuxunix"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1360"}],"version-history":[{"count":2,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1360\/revisions"}],"predecessor-version":[{"id":1362,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1360\/revisions\/1362"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}