Skip to content

Commit

Permalink
rofl-containers: Resize persistent storage filesystem if needed
Browse files Browse the repository at this point in the history
  • Loading branch information
kostko committed Jan 17, 2025
1 parent c5aaba3 commit 2f1ea8f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rofl-containers/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ pub async fn init(kms: Arc<dyn services::kms::KmsService>) -> Result<()> {
format_storage(&storage_key)?;
}

// Resize filesystem if needed.
run_cmd!(
sh -c "e2fsck -f -p /dev/mapper/storage || [ $? -le 2 ]";
resize2fs "/dev/mapper/storage";
)?;
// Mount filesystem as /storage.
run_cmd!(mount "/dev/mapper/storage" "/storage")?;

Expand Down

0 comments on commit 2f1ea8f

Please sign in to comment.