public inbox for development@lists.ipfire.org
 help / color / mirror / Atom feed
* [PATCH 1/2] installer: Remove the option to install without journal
@ 2024-12-14 12:05 Michael Tremer
  2024-12-14 12:05 ` [PATCH 2/2] flash-image: Create a journal when the filesystem is being created Michael Tremer
  2024-12-14 12:57 ` [PATCH 1/2] installer: Remove the option to install without journal Adolf Belka
  0 siblings, 2 replies; 4+ messages in thread
From: Michael Tremer @ 2024-12-14 12:05 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 2375 bytes --]

It was possible to install a new system without a journal. I think this
is a very outdated concept now and should be avoided in favour of
filesystem integrity.

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 src/installer/hw.c   | 5 -----
 src/installer/hw.h   | 7 +++----
 src/installer/main.c | 1 -
 3 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/src/installer/hw.c b/src/installer/hw.c
index 6bf05b185..577780af9 100644
--- a/src/installer/hw.c
+++ b/src/installer/hw.c
@@ -923,10 +923,6 @@ static int hw_format_filesystem(const char* path, int fs, const char* output) {
 	} else if (fs == HW_FS_EXT4) {
 		snprintf(cmd, sizeof(cmd), "/sbin/mke2fs -FF -T ext4 %s", path);
 
-	// EXT4 w/o journal
-	} else if (fs == HW_FS_EXT4_WO_JOURNAL) {
-		snprintf(cmd, sizeof(cmd), "/sbin/mke2fs -FF -T ext4 -O ^has_journal %s", path);
-
 	// XFS
 	} else if (fs == HW_FS_XFS) {
 		snprintf(cmd, sizeof(cmd), "/sbin/mkfs.xfs -f %s", path);
@@ -1027,7 +1023,6 @@ int hw_mount_filesystems(struct hw_destination* dest, const char* prefix) {
 	const char* filesystem;
 	switch (dest->filesystem) {
 		case HW_FS_EXT4:
-		case HW_FS_EXT4_WO_JOURNAL:
 			filesystem = "ext4";
 			break;
 
diff --git a/src/installer/hw.h b/src/installer/hw.h
index 92f32b67f..e1c3d345f 100644
--- a/src/installer/hw.h
+++ b/src/installer/hw.h
@@ -43,10 +43,9 @@
 
 #define HW_FS_SWAP                    0
 #define HW_FS_EXT4                    1
-#define HW_FS_EXT4_WO_JOURNAL         2
-#define HW_FS_XFS                     3
-#define HW_FS_FAT32                   4
-#define HW_FS_BTRFS                   5
+#define HW_FS_XFS                     2
+#define HW_FS_FAT32                   3
+#define HW_FS_BTRFS                   4
 
 #define HW_FS_DEFAULT                 HW_FS_EXT4
 
diff --git a/src/installer/main.c b/src/installer/main.c
index 9e3f4af83..9b9c630c3 100644
--- a/src/installer/main.c
+++ b/src/installer/main.c
@@ -644,7 +644,6 @@ int main(int argc, char *argv[]) {
 			char* description;
 		} filesystems[] = {
 			{ HW_FS_EXT4,            _("ext4 Filesystem") },
-			{ HW_FS_EXT4_WO_JOURNAL, _("ext4 Filesystem without journal") },
 			{ HW_FS_XFS,             _("XFS Filesystem") },
 			{ HW_FS_BTRFS,           _("BTRFS Filesystem (EXPERIMENTAL)") },
 			{ 0, NULL },
-- 
2.39.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH 2/2] flash-image: Create a journal when the filesystem is being created
  2024-12-14 12:05 [PATCH 1/2] installer: Remove the option to install without journal Michael Tremer
@ 2024-12-14 12:05 ` Michael Tremer
  2024-12-14 12:58   ` Adolf Belka
  2024-12-14 12:57 ` [PATCH 1/2] installer: Remove the option to install without journal Adolf Belka
  1 sibling, 1 reply; 4+ messages in thread
From: Michael Tremer @ 2024-12-14 12:05 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 1945 bytes --]

We recently started to have problems when a new installation was
launched from the flash image that creating the journal corrupted the
filesystem on the next mount operation.

Since we would like all IPFire installations to have a journal, we
create this now when we create the image and won't try to add it later.

Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
---
 lfs/flash-images                  |  2 +-
 src/initscripts/system/partresize | 13 -------------
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/lfs/flash-images b/lfs/flash-images
index 30513f0bc..27d3a89d7 100644
--- a/lfs/flash-images
+++ b/lfs/flash-images
@@ -126,7 +126,7 @@ endif
 ifeq "$(EFI)" "1"
 	mkfs.vfat $(PART_EFI)
 endif
-	mkfs.ext4 -O ^has_journal,extent -F $(PART_ROOT)
+	mkfs.ext4 -F $(PART_ROOT)
 
 	# Most systems that use Flashimages has no RTC at boot
 	# so the interval check should disables
diff --git a/src/initscripts/system/partresize b/src/initscripts/system/partresize
index df9c43991..832bc7237 100644
--- a/src/initscripts/system/partresize
+++ b/src/initscripts/system/partresize
@@ -48,7 +48,6 @@ 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
@@ -110,18 +109,6 @@ 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
 
-- 
2.39.5


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] installer: Remove the option to install without journal
  2024-12-14 12:05 [PATCH 1/2] installer: Remove the option to install without journal Michael Tremer
  2024-12-14 12:05 ` [PATCH 2/2] flash-image: Create a journal when the filesystem is being created Michael Tremer
@ 2024-12-14 12:57 ` Adolf Belka
  1 sibling, 0 replies; 4+ messages in thread
From: Adolf Belka @ 2024-12-14 12:57 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 2613 bytes --]

Reviewed-by: Adolf Belka <adolf.belka(a)ipfire.org>

On 14/12/2024 13:05, Michael Tremer wrote:
> It was possible to install a new system without a journal. I think this
> is a very outdated concept now and should be avoided in favour of
> filesystem integrity.
>
> Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
> ---
>   src/installer/hw.c   | 5 -----
>   src/installer/hw.h   | 7 +++----
>   src/installer/main.c | 1 -
>   3 files changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/src/installer/hw.c b/src/installer/hw.c
> index 6bf05b185..577780af9 100644
> --- a/src/installer/hw.c
> +++ b/src/installer/hw.c
> @@ -923,10 +923,6 @@ static int hw_format_filesystem(const char* path, int fs, const char* output) {
>   	} else if (fs == HW_FS_EXT4) {
>   		snprintf(cmd, sizeof(cmd), "/sbin/mke2fs -FF -T ext4 %s", path);
>   
> -	// EXT4 w/o journal
> -	} else if (fs == HW_FS_EXT4_WO_JOURNAL) {
> -		snprintf(cmd, sizeof(cmd), "/sbin/mke2fs -FF -T ext4 -O ^has_journal %s", path);
> -
>   	// XFS
>   	} else if (fs == HW_FS_XFS) {
>   		snprintf(cmd, sizeof(cmd), "/sbin/mkfs.xfs -f %s", path);
> @@ -1027,7 +1023,6 @@ int hw_mount_filesystems(struct hw_destination* dest, const char* prefix) {
>   	const char* filesystem;
>   	switch (dest->filesystem) {
>   		case HW_FS_EXT4:
> -		case HW_FS_EXT4_WO_JOURNAL:
>   			filesystem = "ext4";
>   			break;
>   
> diff --git a/src/installer/hw.h b/src/installer/hw.h
> index 92f32b67f..e1c3d345f 100644
> --- a/src/installer/hw.h
> +++ b/src/installer/hw.h
> @@ -43,10 +43,9 @@
>   
>   #define HW_FS_SWAP                    0
>   #define HW_FS_EXT4                    1
> -#define HW_FS_EXT4_WO_JOURNAL         2
> -#define HW_FS_XFS                     3
> -#define HW_FS_FAT32                   4
> -#define HW_FS_BTRFS                   5
> +#define HW_FS_XFS                     2
> +#define HW_FS_FAT32                   3
> +#define HW_FS_BTRFS                   4
>   
>   #define HW_FS_DEFAULT                 HW_FS_EXT4
>   
> diff --git a/src/installer/main.c b/src/installer/main.c
> index 9e3f4af83..9b9c630c3 100644
> --- a/src/installer/main.c
> +++ b/src/installer/main.c
> @@ -644,7 +644,6 @@ int main(int argc, char *argv[]) {
>   			char* description;
>   		} filesystems[] = {
>   			{ HW_FS_EXT4,            _("ext4 Filesystem") },
> -			{ HW_FS_EXT4_WO_JOURNAL, _("ext4 Filesystem without journal") },
>   			{ HW_FS_XFS,             _("XFS Filesystem") },
>   			{ HW_FS_BTRFS,           _("BTRFS Filesystem (EXPERIMENTAL)") },
>   			{ 0, NULL },

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] flash-image: Create a journal when the filesystem is being created
  2024-12-14 12:05 ` [PATCH 2/2] flash-image: Create a journal when the filesystem is being created Michael Tremer
@ 2024-12-14 12:58   ` Adolf Belka
  0 siblings, 0 replies; 4+ messages in thread
From: Adolf Belka @ 2024-12-14 12:58 UTC (permalink / raw)
  To: development

[-- Attachment #1: Type: text/plain, Size: 2161 bytes --]

Reviewed-by: Adolf Belka <adolf.belka(a)ipfire.org>

On 14/12/2024 13:05, Michael Tremer wrote:
> We recently started to have problems when a new installation was
> launched from the flash image that creating the journal corrupted the
> filesystem on the next mount operation.
>
> Since we would like all IPFire installations to have a journal, we
> create this now when we create the image and won't try to add it later.
>
> Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
> ---
>   lfs/flash-images                  |  2 +-
>   src/initscripts/system/partresize | 13 -------------
>   2 files changed, 1 insertion(+), 14 deletions(-)
>
> diff --git a/lfs/flash-images b/lfs/flash-images
> index 30513f0bc..27d3a89d7 100644
> --- a/lfs/flash-images
> +++ b/lfs/flash-images
> @@ -126,7 +126,7 @@ endif
>   ifeq "$(EFI)" "1"
>   	mkfs.vfat $(PART_EFI)
>   endif
> -	mkfs.ext4 -O ^has_journal,extent -F $(PART_ROOT)
> +	mkfs.ext4 -F $(PART_ROOT)
>   
>   	# Most systems that use Flashimages has no RTC at boot
>   	# so the interval check should disables
> diff --git a/src/initscripts/system/partresize b/src/initscripts/system/partresize
> index df9c43991..832bc7237 100644
> --- a/src/initscripts/system/partresize
> +++ b/src/initscripts/system/partresize
> @@ -48,7 +48,6 @@ 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
> @@ -110,18 +109,6 @@ 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
>   

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-14 12:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-12-14 12:05 [PATCH 1/2] installer: Remove the option to install without journal Michael Tremer
2024-12-14 12:05 ` [PATCH 2/2] flash-image: Create a journal when the filesystem is being created Michael Tremer
2024-12-14 12:58   ` Adolf Belka
2024-12-14 12:57 ` [PATCH 1/2] installer: Remove the option to install without journal Adolf Belka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox