public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
To: pbs-devel@lists.proxmox.com
Subject: [pbs-devel] [PATCH proxmox-backup 1/1] ext4 filesystems no longer reserve blocks when created as a datastore
Date: Fri, 27 May 2022 12:57:27 +0200	[thread overview]
Message-ID: <20220527105728.132412-1-d.tschlatscher@proxmox.com> (raw)

Ext4 Filesystems reserve about 5% of all available blocks for usage by
the root user. While this can be helpful for root partitions and mount
points, it is significantly less so for datastores. Therefore, ext4
filesystems are created with no reserved blocks, increasing the
available storage for unpriviliged backup users.
Some more rationale can be found in #4077:
https://bugzilla.proxmox.com/show_bug.cgi?id=4077

Signed-off-by: Daniel Tschlatscher <d.tschlatscher@proxmox.com>
---
 src/tools/disks/mod.rs | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/tools/disks/mod.rs b/src/tools/disks/mod.rs
index 568dccbf..9a19f0c1 100644
--- a/src/tools/disks/mod.rs
+++ b/src/tools/disks/mod.rs
@@ -979,10 +979,14 @@ pub fn create_file_system(disk: &Disk, fs_type: FileSystemType) -> Result<(), Er
         None => bail!("disk {:?} has no node in /dev", disk.syspath()),
     };
 
-    let fs_type = fs_type.to_string();
-
     let mut command = std::process::Command::new("mkfs");
-    command.args(&["-t", &fs_type]);
+
+    command.args(&["-t", &fs_type.to_string()]);
+
+    if matches!(fs_type, FileSystemType::Ext4) {
+        command.args(&["-m", "0"]);
+    }
+
     command.arg(disk_path);
 
     proxmox_sys::command::run_command(command, None)?;
-- 
2.30.2





             reply	other threads:[~2022-05-27 10:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27 10:57 Daniel Tschlatscher [this message]
2022-05-27 10:57 ` [pbs-devel] [PATCH proxmox-backup 1/1] fix #4077: Estimated Full metric on ext4 file systems Daniel Tschlatscher
2022-05-27 11:40   ` Daniel Tschlatscher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220527105728.132412-1-d.tschlatscher@proxmox.com \
    --to=d.tschlatscher@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal