From: Theodore Ts'o Date: Fri, 8 Nov 2002 17:26:37 +0000 (-0500) Subject: fsimext2.c (set_mkfs_options): Synchronize with EVMS CVS rev X-Git-Tag: E2FSPROGS-1_31~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f6169c31bdb5c12e822dde60e6c08393d55e6a8;p=thirdparty%2Fe2fsprogs.git fsimext2.c (set_mkfs_options): Synchronize with EVMS CVS rev 1.7 (2002/09/11): Add a hack to force mkfs won't a blocksize equal to the hardsector size if it is larger than 512 bytes. --- diff --git a/lib/evms/ChangeLog b/lib/evms/ChangeLog index 307163c3d..f4c0b3296 100644 --- a/lib/evms/ChangeLog +++ b/lib/evms/ChangeLog @@ -1,5 +1,10 @@ 2002-11-08 Theodore Ts'o + * fsimext2.c (set_mkfs_options): Synchronize with EVMS CVS rev + 1.7 (2002/09/11): Add a hack to force mkfs won't a + blocksize equal to the hardsector size if it is larger + than 512 bytes. + * fs_ext2.c (fs_expand, fs_shrink): Synchronize with EVMS CVS rev 1.13 (2002/09/03). Add better error handling for child processes that die unexpectedly. diff --git a/lib/evms/fsimext2.c b/lib/evms/fsimext2.c index a0e7344ab..27a7f4f54 100644 --- a/lib/evms/fsimext2.c +++ b/lib/evms/fsimext2.c @@ -172,6 +172,30 @@ void set_mkfs_options( option_array_t * options, /* 'quiet' option */ argv[1] = "-q"; + /* the following is a big hack to make sure that we don't use a block */ + /* size smaller than hardsector size since this does not work. */ + /* would be nice if the ext2/3 utilities (mkfs) handled this themselves */ + /* also, eventually we will implement this as a user option to manually */ + /* set block size */ + if (volume->object->geometry.bytes_per_sector != EVMS_VSECTOR_SIZE) { + switch (volume->object->geometry.bytes_per_sector) { + case 1024: + argv[2] = "-b1024"; + opt_count++; + break; + case 2048: + argv[2] = "-b2048"; + opt_count++; + break; + case 4096: + argv[2] = "-b4096"; + opt_count++; + break; + default: + /* not one we expect, just skip it */ + } + } + for ( i=0; icount; i++ ) { if ( options->option[i].is_number_based ) {