From patchwork Mon Jun 5 07:30:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Fitzenreiter X-Patchwork-Id: 6927 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4QZQHt16nZz3wlB for ; Mon, 5 Jun 2023 07:30:34 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4QZQHr0cXcz1VP; Mon, 5 Jun 2023 07:30:32 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4QZQHq67dnz2yfc; Mon, 5 Jun 2023 07:30:31 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4QZQHq1fPpz2xZK for ; Mon, 5 Jun 2023 07:30:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4QZQHm5NfSzlC; Mon, 5 Jun 2023 07:30:28 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1685950230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=iD39QcejJJzVMS7WcbxrVJHUyYxrp38+FcXVr6MjtWg=; b=hg9Jwwm/NYoppBF5c7cDFk/6kYQCHT1sEEdeFsfP4XMpS+oq9SEKHtoLp6LlJuv6dkaocW topCkfnVAMvGIuBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1685950230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=iD39QcejJJzVMS7WcbxrVJHUyYxrp38+FcXVr6MjtWg=; b=Y7FGDwSrasyrFhXDRQlZoDbZ4mOpuvjldQhk3QSs1emC27alO17TyDq6r34RyknB8YFtdf 5vTCWVWeoFMxUHDahUn5aDLyzrZtYNeMbCb7sZkDBUCdVYQPnNQ0p6fPDxwZLDamjO6Vfm sXaotK42gaswifxeZx/n/Lw1CsEOZZBP6nG53nUnKOb65h3KxFB5P/pgalLSGdwBnzlNVH EhEKAfJ8D7anTJdiVkZQm6Dc3ndP/+8aTJHeuzpkWNS6R71D5/Bl1aoiSMEIdKK86+9Chr Pc6cBFcwZKWz/XT9JN1AkQLMXTmtVeJon6ODGQn3kZ4ZpuIFJ4la2xzwhlTlAQ== From: Arne Fitzenreiter To: development@lists.ipfire.org Subject: [PATCH 1/2] partresize: remove buggy code Date: Mon, 5 Jun 2023 09:30:28 +0200 Message-Id: <20230605073029.2971-1-arne_f@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arne Fitzenreiter Errors-To: development-bounces@lists.ipfire.org Sender: "Development" DRV is not defined so this code is useless. Signed-off-by: Arne Fitzenreiter --- src/initscripts/system/partresize | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/initscripts/system/partresize b/src/initscripts/system/partresize index 272fbe482..832bc7237 100644 --- a/src/initscripts/system/partresize +++ b/src/initscripts/system/partresize @@ -112,11 +112,6 @@ case "${1}" in boot_mesg "Growing root partition to maximum size..." echo -e ',+' | sfdisk --no-reread -f -N${part_num} "${root_dev}" 2>/dev/null - # Update c,h,s values of the boot partition... - if [ ${part_num} -ne 1 -a -b "${root_dev}1" ]; then - echo -e ',' | sfdisk --no-reread -f -N1 ${DRV} &> /dev/null - fi - # The filesystem should be resized after # this operation touch /.resizefs From patchwork Mon Jun 5 07:30:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arne Fitzenreiter X-Patchwork-Id: 6928 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4QZQHv1JQsz3wlB for ; Mon, 5 Jun 2023 07:30:35 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4QZQHr2b5Jz2DP; Mon, 5 Jun 2023 07:30:32 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4QZQHq701hz30Dy; Mon, 5 Jun 2023 07:30:31 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4QZQHq2kS4z2y0p for ; Mon, 5 Jun 2023 07:30:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4QZQHq0DJpz1Pn; Mon, 5 Jun 2023 07:30:30 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1685950231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VA7YHCUuu2olgEGaQHQw5xz5A05IlwJjfVWIcvLOL0I=; b=D+DPTb850chjDw+IIWK7LMzovRd19TSCthqfXJOvALEmCKEC6cdYO5uTCX3f7AyNO7chUs whIm+YWNY0pQuLDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1685950231; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VA7YHCUuu2olgEGaQHQw5xz5A05IlwJjfVWIcvLOL0I=; b=f7yjbiY7DpSRLdMfsSxR25ndOZ7+f8ysxMIdE265wI1E9XN2gIhKmD162dyYYt9Mud/zbV /wE7BJ1w2J+iU8ZFoJhOi2GTEaSQ310Xb2GwiBgHiD1rP99hZDmS6m4Qm6u38bVXSWUsV4 09WFsaeijaeUO8dTnaQD0Oa8ZQ0aI3MpFTnIdayA2IqlOxOggLSNr9HH3t1lbfofB6xgre ACCCP5SloM70he+3VeXw6nV9I0lNUk0MY+/rKCDP+JOrDhT/7BPlO1Ut8YM3TWKiJKvvfL irTU849DqR785GoqEhzmX74B3DJrc9VQzgI64FNP8/rEjjl0uctvN14X1nhqTg== From: Arne Fitzenreiter To: development@lists.ipfire.org Subject: [PATCH 2/2] partresize: enable journal on ssd's and vm's Date: Mon, 5 Jun 2023 09:30:29 +0200 Message-Id: <20230605073029.2971-2-arne_f@ipfire.org> In-Reply-To: <20230605073029.2971-1-arne_f@ipfire.org> References: <20230605073029.2971-1-arne_f@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Arne Fitzenreiter Errors-To: development-bounces@lists.ipfire.org Sender: "Development" the flashimage is build without journal to not destroy usb thumbdrives or sd cards. On real ssd's and virtual machines it should enabled for higher data security. So this patch add the journal is drive support smart. Signed-off-by: Arne Fitzenreiter --- src/initscripts/system/partresize | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/initscripts/system/partresize b/src/initscripts/system/partresize index 832bc7237..df9c43991 100644 --- a/src/initscripts/system/partresize +++ b/src/initscripts/system/partresize @@ -48,6 +48,7 @@ case "${1}" in # Azure and Google Compute Platform if running_on_ec2 || running_on_oci || running_on_azure || running_on_gcp; then scon="on" + journal="on" fi mount /boot > /dev/null @@ -109,6 +110,18 @@ case "${1}" in root_dev="${dev::-2}" fi + # Check if the device support smart + smartctl --smart=on "${root_dev}" > /dev/null + if [ ${?} = 0 ]; then + journal="on" + fi + + # Enable journal + if [ "${journal}" = "on" ]; then + boot_mesg "Create journal on "${dev}" ..." + tune2fs -O has_journal "${dev}" + fi + boot_mesg "Growing root partition to maximum size..." echo -e ',+' | sfdisk --no-reread -f -N${part_num} "${root_dev}" 2>/dev/null