gptfdisk-general Mailing List for GPT fdisk (Page 2)
Brought to you by:
srs5694
You can subscribe to this list here.
| 2011 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(5) |
Sep
(1) |
Oct
(1) |
Nov
(2) |
Dec
(4) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2012 |
Jan
(2) |
Feb
|
Mar
(3) |
Apr
(1) |
May
(2) |
Jun
(5) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
(6) |
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(3) |
Nov
|
Dec
|
| 2014 |
Jan
(17) |
Feb
(3) |
Mar
(3) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(5) |
Jul
|
Aug
|
Sep
(1) |
Oct
(8) |
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2017 |
Jan
(1) |
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(13) |
Aug
(1) |
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2021 |
Jan
(3) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(20) |
Jul
|
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
(22) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2024 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2025 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
|
From: Bin M. <bme...@gm...> - 2022-04-02 07:00:48
|
At present the makefiles for linux/freebsd builds don't use the "-O2" compiler flag, while other platform builds do. Let's add it to keep consistency with others. Signed-off-by: Bin Meng <bme...@gm...> --- Makefile | 4 ++-- Makefile.freebsd | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 58e9d2d..d1ac530 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ -#CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 -CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 +#CXXFLAGS+=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 +CXXFLAGS+=-O2 -Wall -D_FILE_OFFSET_BITS=64 LDFLAGS+= LIB_NAMES=crc32 support guid gptpart mbrpart basicmbr mbr gpt bsd parttypes attributes diskio diskio-unix MBR_LIBS=support diskio diskio-unix basicmbr mbrpart diff --git a/Makefile.freebsd b/Makefile.freebsd index 13fc0fb..c0dd416 100644 --- a/Makefile.freebsd +++ b/Makefile.freebsd @@ -1,6 +1,6 @@ CXX=clang++ -#CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 -I/usr/local/include -CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include +#CXXFLAGS+=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 -I/usr/local/include +CXXFLAGS+=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include LDFLAGS+= LIB_NAMES=crc32 support guid gptpart mbrpart basicmbr mbr gpt bsd parttypes attributes diskio diskio-unix MBR_LIBS=support diskio diskio-unix basicmbr mbrpart -- 2.25.1 |
|
From: Bin M. <bme...@gm...> - 2022-04-02 07:00:45
|
At present the makefiles for mac/mingw* builds have the "-g" compiler flag, while other platform builds don't. Let's drop it given "-g" is only useful for a DEBUG build. Signed-off-by: Bin Meng <bme...@gm...> --- Makefile.mac | 4 ++-- Makefile.mingw | 4 ++-- Makefile.mingw64 | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile.mac b/Makefile.mac index e30b592..bf68b83 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -2,8 +2,8 @@ CXX=c++ # FATBINFLAGS=-arch x86_64 -arch i386 -mmacosx-version-min=10.9 FATBINFLAGS=-arch x86_64 -arch arm64 -mmacosx-version-min=10.9 THINBINFLAGS=-arch x86_64 -mmacosx-version-min=10.9 -#CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 -I/opt/local/include -I/usr/local/include -I/opt/local/include -g -CXXFLAGS=$(FATBINFLAGS) -O2 -Wall -D_FILE_OFFSET_BITS=64 -stdlib=libc++ -I/opt/local/include -I /usr/local/include -I/opt/local/include -g +#CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 -I/opt/local/include -I/usr/local/include -I/opt/local/include +CXXFLAGS=$(FATBINFLAGS) -O2 -Wall -D_FILE_OFFSET_BITS=64 -stdlib=libc++ -I/opt/local/include -I /usr/local/include -I/opt/local/include LIB_NAMES=crc32 support guid gptpart mbrpart basicmbr mbr gpt bsd parttypes attributes diskio diskio-unix MBR_LIBS=support diskio diskio-unix basicmbr mbrpart #LIB_SRCS=$(NAMES:=.cc) diff --git a/Makefile.mingw b/Makefile.mingw index 11f6242..199547c 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -1,7 +1,7 @@ CXX=/usr/bin/i686-w64-mingw32-g++ STRIP=/usr/bin/i686-w64-mingw32-strip -CXXFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 -g -#CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include -I/opt/local/include -g +CXXFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 +#CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include -I/opt/local/include LIB_NAMES=guid gptpart bsd parttypes attributes crc32 mbrpart basicmbr mbr gpt support diskio diskio-windows MBR_LIBS=support diskio diskio-windows basicmbr mbrpart LIB_SRCS=$(NAMES:=.cc) diff --git a/Makefile.mingw64 b/Makefile.mingw64 index 7c0db2d..fc8dfd6 100644 --- a/Makefile.mingw64 +++ b/Makefile.mingw64 @@ -1,7 +1,7 @@ CXX=/usr/bin/x86_64-w64-mingw32-g++ STRIP=/usr/bin/x86_64-w64-mingw32-strip -CXXFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 -g -#CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include -I/opt/local/include -g +CXXFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 +#CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include -I/opt/local/include LIB_NAMES=guid gptpart bsd parttypes attributes crc32 mbrpart basicmbr mbr gpt support diskio diskio-windows MBR_LIBS=support diskio diskio-windows basicmbr mbrpart LIB_SRCS=$(NAMES:=.cc) -- 2.25.1 |
|
From: Bin M. <bme...@gm...> - 2022-04-02 07:00:45
|
When built with -O2 flag, there is a compiler warning:
gptcl.cc: In member function 'int GPTDataCL::BuildMBR(char*, int)':
gptcl.cc:507:8: warning: 'eeLast' may be used uninitialized in this
function [-Wmaybe-uninitialized]
507 | int eeLast, mbrNum = 0;
| ^~~~~~
The code logic is correct despite the warning. The warning can be
silenced by initializing the local variable.
Signed-off-by: Bin Meng <bme...@gm...>
---
gptcl.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gptcl.cc b/gptcl.cc
index 3995093..0141994 100644
--- a/gptcl.cc
+++ b/gptcl.cc
@@ -504,7 +504,7 @@ int GPTDataCL::DoOptions(int argc, char* argv[]) {
// Create a hybrid or regular MBR from GPT data structures
int GPTDataCL::BuildMBR(char* argument, int isHybrid) {
int numParts, allOK = 1, i, origPartNum;
- int eeLast, mbrNum = 0;
+ int eeLast = 0, mbrNum = 0;
MBRPart newPart;
BasicMBRData newMBR;
--
2.25.1
|
|
From: Bin M. <bme...@gm...> - 2022-04-02 07:00:43
|
The executables to be cleaned in the freebsd/mingw* builds are either incomplete or incorrect. Fix the 'clean' rule. Signed-off-by: Bin Meng <bme...@gm...> --- Makefile.freebsd | 2 +- Makefile.mingw | 2 +- Makefile.mingw64 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile.freebsd b/Makefile.freebsd index b91ea94..13fc0fb 100644 --- a/Makefile.freebsd +++ b/Makefile.freebsd @@ -30,7 +30,7 @@ lint: #no pre-reqs lint $(SRCS) clean: #no pre-reqs - rm -f core *.o *~ gdisk sgdisk + rm -f core *.o *~ gdisk cgdisk sgdisk fixparts # what are the source dependencies depend: $(SRCS) diff --git a/Makefile.mingw b/Makefile.mingw index 608e3c0..11f6242 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -25,7 +25,7 @@ lint: #no pre-reqs lint $(SRCS) clean: #no pre-reqs - rm -f core *.o *~ gdisk.exe sgdisk.exe + rm -f core *.o *~ gdisk32.exe fixparts32.exe strip: #no pre-reqs $(STRIP) gdisk32.exe fixparts32.exe diff --git a/Makefile.mingw64 b/Makefile.mingw64 index 8907130..7c0db2d 100644 --- a/Makefile.mingw64 +++ b/Makefile.mingw64 @@ -25,7 +25,7 @@ lint: #no pre-reqs lint $(SRCS) clean: #no pre-reqs - rm -f core *.o *~ gdisk64.exe sgdisk64.exe + rm -f core *.o *~ gdisk64.exe fixparts64.exe strip: #no pre-reqs $(STRIP) gdisk64.exe fixparts64.exe -- 2.25.1 |
|
From: Bin M. <bme...@gm...> - 2022-04-02 07:00:40
|
There is no such source file called testguid.* hence the 'testguid' build target is invalid. Remove it. Signed-off-by: Bin Meng <bme...@gm...> --- Makefile.mac | 3 --- 1 file changed, 3 deletions(-) diff --git a/Makefile.mac b/Makefile.mac index 1dcb065..e30b592 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -31,9 +31,6 @@ sgdisk: $(LIB_OBJS) gptcl.o sgdisk.o fixparts: $(MBR_LIB_OBJS) fixparts.o $(CXX) $(MBR_LIB_OBJS) fixparts.o $(LDFLAGS) $(FATBINFLAGS) -o fixparts -testguid: $(LIB_OBJS) testguid.o - $(CXX) $(LIB_OBJS) testguid.o -o testguid - lint: #no pre-reqs lint $(SRCS) -- 2.25.1 |
|
From: Bin M. <bme...@gm...> - 2022-04-02 07:00:38
|
There is no C source file to compile, hence CC/CFLAGS are not needed. Signed-off-by: Bin Meng <bme...@gm...> --- Makefile | 1 - Makefile.freebsd | 2 -- Makefile.mac | 2 -- Makefile.mingw | 2 -- Makefile.mingw64 | 2 -- 5 files changed, 9 deletions(-) diff --git a/Makefile b/Makefile index 0d7309c..58e9d2d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,3 @@ -CFLAGS+=-D_FILE_OFFSET_BITS=64 #CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 LDFLAGS+= diff --git a/Makefile.freebsd b/Makefile.freebsd index 4b4b616..b91ea94 100644 --- a/Makefile.freebsd +++ b/Makefile.freebsd @@ -1,6 +1,4 @@ -CC=clang CXX=clang++ -CFLAGS+=-D_FILE_OFFSET_BITS=64 #CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 -I/usr/local/include CXXFLAGS+=-Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include LDFLAGS+= diff --git a/Makefile.mac b/Makefile.mac index ea21fa6..1dcb065 100644 --- a/Makefile.mac +++ b/Makefile.mac @@ -1,9 +1,7 @@ -CC=gcc CXX=c++ # FATBINFLAGS=-arch x86_64 -arch i386 -mmacosx-version-min=10.9 FATBINFLAGS=-arch x86_64 -arch arm64 -mmacosx-version-min=10.9 THINBINFLAGS=-arch x86_64 -mmacosx-version-min=10.9 -CFLAGS=$(FATBINFLAGS) -O2 -D_FILE_OFFSET_BITS=64 -g #CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -D USE_UTF16 -I/opt/local/include -I/usr/local/include -I/opt/local/include -g CXXFLAGS=$(FATBINFLAGS) -O2 -Wall -D_FILE_OFFSET_BITS=64 -stdlib=libc++ -I/opt/local/include -I /usr/local/include -I/opt/local/include -g LIB_NAMES=crc32 support guid gptpart mbrpart basicmbr mbr gpt bsd parttypes attributes diskio diskio-unix diff --git a/Makefile.mingw b/Makefile.mingw index acfff64..608e3c0 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -1,7 +1,5 @@ -CC=/usr/bin/i686-w64-mingw32-gcc CXX=/usr/bin/i686-w64-mingw32-g++ STRIP=/usr/bin/i686-w64-mingw32-strip -CFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 -g CXXFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 -g #CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include -I/opt/local/include -g LIB_NAMES=guid gptpart bsd parttypes attributes crc32 mbrpart basicmbr mbr gpt support diskio diskio-windows diff --git a/Makefile.mingw64 b/Makefile.mingw64 index 7e4b32b..8907130 100644 --- a/Makefile.mingw64 +++ b/Makefile.mingw64 @@ -1,7 +1,5 @@ -CC=/usr/bin/x86_64-w64-mingw32-gcc CXX=/usr/bin/x86_64-w64-mingw32-g++ STRIP=/usr/bin/x86_64-w64-mingw32-strip -CFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 -g CXXFLAGS=-O2 -Wall -static -static-libgcc -static-libstdc++ -D_FILE_OFFSET_BITS=64 -g #CXXFLAGS=-O2 -Wall -D_FILE_OFFSET_BITS=64 -I /usr/local/include -I/opt/local/include -g LIB_NAMES=guid gptpart bsd parttypes attributes crc32 mbrpart basicmbr mbr gpt support diskio diskio-windows -- 2.25.1 |
|
From: Bin M. <bme...@gm...> - 2022-04-02 07:00:35
|
This series was originated from trying to build the sgdisk executable for Windows host, that has not been formally supported as of today. The series starts from several patches to do some clean-ups to existing makefiles for various platforms (patch 1, 2, 3, 4, 6, 7). Patch 5 is a build warning fix as the result of adding the '-O2' flag. Patch 8 fixes several issues in the 'sgdisk' build rule for mingw* builds, and patch 9 enables the sgdisk build by default. Path 10 does further clean-up to simplify the build rules. Path 11 and 12 are fixes when using newer version gcc (e.g.: gcc 11) which is the one that ships on MSYS2. Patch 13 switches the Windows executable build from static to shared. Patch 14 allows MinGW compiler on both Linux and Windows to be used. Patch 15 updates the Windows documentation with the latest information. Bin Meng (15): makefile: Drop CC and CFLAGS makefile: Remove the 'testguid' rule for mac build makefile: Fix the 'clean' rule for freebsd/mingw* builds makefile: Drop "-g" compiler flag for mac/mingw* builds gptcl: Silence the compiler warning in BuildMBR() makefile: Add "-O2" compiler flag for linux/freebsd builds makefile: Drop duplicated "-static-libgcc" flag in mingw* builds makefile: Fix the 'sgdisk' rule for mingw* builds makefile: Enable building sgdisk by default for mingw* builds makefile: Consolidate build rules with LDFLAGS and LDLIBS crc32: Remove deprecated 'register' specifier for C++17 Explicitly namespace-qualify all std names in header files makefile: Switch to building shared executables for mingw* builds makefile: Avoid absolute path in CXX for mingw* builds README: Update build instructions for Windows executables Makefile | 17 +++++++---------- Makefile.freebsd | 22 +++++++++------------- Makefile.mac | 22 +++++++--------------- Makefile.mingw | 26 +++++++++++++------------- Makefile.mingw64 | 26 +++++++++++++------------- README.Windows | 37 ++++++++++++++++++++----------------- attributes.h | 10 ++++------ basicmbr.h | 12 +++++------- bsd.h | 5 +---- crc32.cc | 2 +- diskio.h | 16 +++++++--------- gdisk.cc | 2 ++ gpt.h | 20 +++++++++----------- gptcl.cc | 4 +++- gptcl.h | 10 ++++------ gptcurses.h | 10 ++++------ gptpart.cc | 11 +++++------ gptpart.h | 6 ++---- gpttext.h | 12 +++++------- guid.h | 12 +++++------- mbr.h | 4 +--- mbrpart.h | 2 -- parttypes.h | 16 +++++++--------- support.h | 16 +++++++--------- 24 files changed, 141 insertions(+), 179 deletions(-) -- 2.25.1 |
|
From: Sergei T. <sl...@gm...> - 2021-11-28 18:56:59
|
`ncuses-6.3` added printf-style function attributes and now makes
it easier to catch cases when user input is used in palce of format
string when built with CFLAGS=-Werror=format-security:
gptcurses.cc:274:10: error:
format not a string literal and no format arguments [-Werror=format-security]
274 | printw(theLine.c_str());
| ~~~~~~^~~~~~~~~~~~~~~~~
Let's wrap all the missing places with "%s" format.
---
gptcurses.cc | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/gptcurses.cc b/gptcurses.cc
index 1fbaad2..aaf113a 100644
--- a/gptcurses.cc
+++ b/gptcurses.cc
@@ -239,22 +239,22 @@ Space* GPTDataCurses::ShowSpace(int spaceNum, int lineNum) {
ClearLine(lineNum);
if (space->partNum == -1) { // space is empty
move(lineNum, 12);
- printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str());
+ printw("%s", BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str());
move(lineNum, 24);
printw("free space");
} else { // space holds a partition
move(lineNum, 3);
printw("%d", space->partNum + 1);
move(lineNum, 12);
- printw(BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str());
+ printw("%s", BytesToIeee((space->lastLBA - space->firstLBA + 1), blockSize).c_str());
move(lineNum, 24);
- printw(space->origPart->GetTypeName().c_str());
+ printw("%s", space->origPart->GetTypeName().c_str());
move(lineNum, 50);
#ifdef USE_UTF16
space->origPart->GetDescription().extract(0, 39, temp, 39);
- printw(temp);
+ printw("%s", temp);
#else
- printw(space->origPart->GetDescription().c_str());
+ printw("%s", space->origPart->GetDescription().c_str());
#endif
} // if/else
} // if
@@ -271,10 +271,10 @@ int GPTDataCurses::DisplayParts(int selected) {
move(lineNum++, 0);
theLine = "Part. # Size Partition Type Partition Name";
- printw(theLine.c_str());
+ printw("%s", theLine.c_str());
move(lineNum++, 0);
theLine = "----------------------------------------------------------------";
- printw(theLine.c_str());
+ printw("%s", theLine.c_str());
numToShow = LINES - RESERVED_TOP - RESERVED_BOTTOM;
pageNum = selected / numToShow;
for (i = pageNum * numToShow; i <= (pageNum + 1) * numToShow - 1; i++) {
@@ -636,7 +636,7 @@ void GPTDataCurses::DisplayOptions(char selectedKey) {
} // if/else
} // for
move(LINES - 1, (COLS - optionDesc.length()) / 2);
- printw(optionDesc.c_str());
+ printw("%s", optionDesc.c_str());
currentKey = selectedKey;
} // if
} // GPTDataCurses::DisplayOptions()
@@ -748,11 +748,11 @@ void GPTDataCurses::DrawMenu(void) {
clear();
move(0, (COLS - title.length()) / 2);
- printw(title.c_str());
+ printw("%s", title.c_str());
move(2, (COLS - drive.length()) / 2);
- printw(drive.c_str());
+ printw("%s", drive.c_str());
move(3, (COLS - size.str().length()) / 2);
- printw(size.str().c_str());
+ printw("%s", size.str().c_str());
DisplayParts(currentSpaceNum);
} // DrawMenu
@@ -802,7 +802,7 @@ void PromptToContinue(void) {
void Report(string theText) {
clear();
move(0, 0);
- printw(theText.c_str());
+ printw("%s", theText.c_str());
move(LINES - 2, (COLS - 29) / 2);
printw("Press any key to continue....");
cbreak();
--
2.33.1
|
|
From: Rod S. <rod...@ro...> - 2021-10-09 22:42:07
|
On 10/9/21 5:26 PM, u3...@ne... wrote: > Rod Smith <rod...@ro...> wrote: > >> Actually, it should never print that message with the --new command. In >> fact, it *SHOULD* never print that message at all; however, I did find a >> stray bit of debugging code that prints such a message in the >> -c/--change-name function of sgdisk. I've removed this code from the >> source code; the change is now in the git repository. >> > > Thank you. > > The following is NOT with the latest git revision. It is with 1.0.8 already > installed here. Hopefully, you already addressed it. > I rechecked my example. Indeed, it doesn't print the partNum message. It > could be I was tired. However, I do get the following: > > # sgdisk --pretend --set-alignment=1 --new=0:0:+100000 --typecode=0:0700 --change-name=0:12345 --attributes=0:set:63 /dev/sdc > Setting name! > partNum is 2 That command includes the --change-name option, which is what was triggering the stray debugging code. > (The long command line is due to this time trying to keep exactly what I > have tried) > I think those messages also appear without --pretend, keeping the rest of > the line as is. Once again, this is NOT with the latest git revision. > Hopefully, you already fixed the problem. > > -- > u34 > >>> . Meaning, while the first available partition number is 3, it prints >>> partNum is 2. Which looks to me a bit confusing. Takes time to get used to. >>> I think it should be a bit more verbose. Something like: >>> >>> Last used partNum is 2 >>> Or, >>> Last used partNum is 2. Will create partNum 3. >>> Or, >>> Highest used partNum is 2 >>> Or, >>> First available partNum is 3 >>> >>> -- >>> u34 >>> >>> >>> _______________________________________________ >>> Gptfdisk-general mailing list >>> Gpt...@li... >>> https://lists.sourceforge.net/lists/listinfo/gptfdisk-general >>> >> >> >> -- >> Rod Smith >> rod...@ro... >> http://www.rodsbooks.com > > > _______________________________________________ > Gptfdisk-general mailing list > Gpt...@li... > https://lists.sourceforge.net/lists/listinfo/gptfdisk-general > -- Rod Smith rod...@ro... http://www.rodsbooks.com |
|
From: <u3...@ne...> - 2021-10-09 21:26:50
|
Rod Smith <rod...@ro...> wrote:
> On 10/9/21 9:53 AM, u3...@ne... wrote:
> > Hello,
> > Relating to 1.0.8, and prior versions:
> > With, for example,
> >
> > sgdisk --new:0:0:+10000000 /dev/sdc
> >
> > it can print
> >
> > partNum is 2
>
> Actually, it should never print that message with the --new command. In
> fact, it *SHOULD* never print that message at all; however, I did find a
> stray bit of debugging code that prints such a message in the
> -c/--change-name function of sgdisk. I've removed this code from the
> source code; the change is now in the git repository.
>
Thank you.
The following is NOT with the latest git revision. It is with 1.0.8 already
installed here. Hopefully, you already addressed it.
I rechecked my example. Indeed, it doesn't print the partNum message. It
could be I was tired. However, I do get the following:
# sgdisk --pretend --set-alignment=1 --new=0:0:+100000 --typecode=0:0700 --change-name=0:12345 --attributes=0:set:63 /dev/sdc
Setting name!
partNum is 2
(The long command line is due to this time trying to keep exactly what I
have tried)
I think those messages also appear without --pretend, keeping the rest of
the line as is. Once again, this is NOT with the latest git revision.
Hopefully, you already fixed the problem.
--
u34
> > . Meaning, while the first available partition number is 3, it prints
> > partNum is 2. Which looks to me a bit confusing. Takes time to get used to.
> > I think it should be a bit more verbose. Something like:
> >
> > Last used partNum is 2
> > Or,
> > Last used partNum is 2. Will create partNum 3.
> > Or,
> > Highest used partNum is 2
> > Or,
> > First available partNum is 3
> >
> > --
> > u34
> >
> >
> > _______________________________________________
> > Gptfdisk-general mailing list
> > Gpt...@li...
> > https://lists.sourceforge.net/lists/listinfo/gptfdisk-general
> >
>
>
> --
> Rod Smith
> rod...@ro...
> http://www.rodsbooks.com
|
|
From: Rod S. <rod...@ro...> - 2021-10-09 20:52:31
|
On 10/9/21 9:53 AM, u3...@ne... wrote: > Hello, > Relating to 1.0.8, and prior versions: > With, for example, > > sgdisk --new:0:0:+10000000 /dev/sdc > > it can print > > partNum is 2 Actually, it should never print that message with the --new command. In fact, it *SHOULD* never print that message at all; however, I did find a stray bit of debugging code that prints such a message in the -c/--change-name function of sgdisk. I've removed this code from the source code; the change is now in the git repository. > . Meaning, while the first available partition number is 3, it prints > partNum is 2. Which looks to me a bit confusing. Takes time to get used to. > I think it should be a bit more verbose. Something like: > > Last used partNum is 2 > Or, > Last used partNum is 2. Will create partNum 3. > Or, > Highest used partNum is 2 > Or, > First available partNum is 3 > > -- > u34 > > > _______________________________________________ > Gptfdisk-general mailing list > Gpt...@li... > https://lists.sourceforge.net/lists/listinfo/gptfdisk-general > -- Rod Smith rod...@ro... http://www.rodsbooks.com |
|
From: <u3...@ne...> - 2021-10-09 14:12:15
|
Hello,
Relating to 1.0.8, and prior versions:
With, for example,
sgdisk --new:0:0:+10000000 /dev/sdc
it can print
partNum is 2
. Meaning, while the first available partition number is 3, it prints
partNum is 2. Which looks to me a bit confusing. Takes time to get used to.
I think it should be a bit more verbose. Something like:
Last used partNum is 2
Or,
Last used partNum is 2. Will create partNum 3.
Or,
Highest used partNum is 2
Or,
First available partNum is 3
--
u34
|
|
From: Rod S. <rod...@ro...> - 2021-06-10 00:47:17
|
This is a heads-up that I've released version 1.0.8, which fixes this bug. It also adds a new feature to gdisk and sgdisk that enables correcting a corrupted partition name. To use this feature: * In gdisk, enter the experts' menu and then type 'b'. This will prompt you for a partition number (unless the disk has just one partition), shows the original and transformed names, and asks for verification. After you've fixed all the broken partition names, type 'w' to write your changes and exit. * In sgdisk, use the new -B/--byte-swap-name parameter, which takes a partition number as an option. If valid, changes will be immediately written to disk. This new feature works on any CPU architecture, but it probably won't be necessary on x86 or x86-64. The bug doesn't affect little-endian CPUs like x86 or x86-64, so the bug fix has no effect on them. GPT fdisk 1.0.8 also adds a new partition type code for the Barebox boot loader. On 6/8/21 1:16 PM, Rod Smith wrote: > On 6/8/21 12:21 PM, Erik Larsson wrote: >> Hi, >> >> On 08-06-2021 18:16, Rod Smith wrote: >>> On 6/8/21 10:54 AM, Christian Ehrhardt wrote: >>>>> There aren't a lot of changes from 1.0.7 to the current >>>>> state, but given that this is kind of important for big-endian systems, >>>>> I'll release this change as 1.0.8 soon -- but I'll give it a day or two >>>>> in case something else crops up. >>>> Agreed, that little wait sounds wise. >>>> I've indirectly also pulled IBM into the boat since they are kind of >>>> the "master of big-endian things". >>>> Maybe (but no promise) they have opinions/hints on this as well. >>> I've been doing some searching to find a way to identify UCS-2 with >>> swapped bytes, so that the program could fix this automatically when >>> reading corrupted partition tables. (GPT technically uses UCS-2, not >>> UTF-16, although the GPT fdisk code has a lot of references to UTF-16 >>> because at one time I relied on an external UTF-16 library.) So far no >>> luck. >> >> >> This problem is impossible to solve perfectly, however I would think >> that partition labels with characters outside the ASCII range are very >> rare in practice so for a start one could check if the first byte is 0 >> in every UCS-2 byte-pair. >> If true, then it's almost certain that the label is in big endian (but I >> would still ask the user to confirm that the big-endian interpretation >> makes more sense). > > Rather than implement something that stands a chance of getting things > badly wrong, I'm leaning toward either doing nothing so that users can > manually change partition labels, if desired; or implement an option to > let users explicitly select partitions to byte-swap their labels. Either > approach enables users to fix problems as they're detected, with the > second option providing some help to users in recovering the original > intended partition labels. Because most disk tools don't use partition > labels for anything important, I don't think it's critical that these > problems be corrected automatically. OTOH, automatically "fixing" > something that's not broken, because of an algorithm that's prone to > false alarms, could be really annoying. > >> There are of course also some ranges that are reserved in Unicode that >> can be used to detect that something might not be right with the >> endianness and if we're limiting the allowed Unicode range to UCS-2 we >> can exclude UTF-16 surrogate pair ranges (disallowing for instance the >> poop emoji as a partition label). >> >> One could also check locality (text doesn't usually use characters from >> all over the place in but stays within a few defined script ranges) and >> there may also be statistical models based on the frequency that Unicode >> characters occur in text, but that's probably taking it too far. :) >> >> Best regards, >> >> - Erik > > -- Rod Smith rod...@ro... http://www.rodsbooks.com |
|
From: Rod S. <rod...@ro...> - 2021-06-09 13:26:13
|
On 6/8/21 6:29 PM, u3...@ne... wrote: > Replying to myself because I had time to prepare a patch for the manual > page. Which is the simple work. In particular, because it doesn't address > the code, that I hope will be written, for sgdisk --info=0. Thanks for the patch. I've applied it and it's in the git repository now. > At 2021-06-07 03:30:50, u3...@ne... wrote: > >> Thank you for your work. >> >> 1) With some entries, such as for -N, --largest-new=num, the manual page >> takes the burden of claryfing -a (--set-alignment). I suggest to take >> the same approach for the references to the -A, -c, -t, and -u options >> within the entry for -n, --new=partnum:start:end. >> > > The following patch fixes only the above long options issue. > > --- a/gptfdisk-1.0.7/sgdisk.8 2021-03-11 00:45:56.000000000 +0000 > +++ b/gptfdisk-1.0.7/sgdisk.8 2021-06-08 21:49:17.679338911 +0000 > @@ -339,7 +339,8 @@ > start of the largest available block for the start sector and the end of > the same block for the end sector. A partnum value of 0 causes the program > to use the first available partition number. Subsequent uses of the > -\fI\-A\fR, \fI\-c\fR, \fI\-t\fR, and \fI\-u\fR options may also use > +\fI\-A\fR (\fI\-\-attributes\fR), \fI\-c\fR (\fI\-\-change\-name\fR), \fI\-t\fR > +(\fI\-\-typecode\fR), and \fI\-u\fR (\fI\-\-partition\-guid\fR) options may also use > \fI0\fR to refer to the same partition. > > .TP > > -- > u34 > >> 2) For the special partnum of 0, --info=0 will show detailed information >> about what -n, --new=partnum:start:end will do with 0 partnum, and a >> 0 start value. >> >> -- >> u34 >> >> >> _______________________________________________ >> Gptfdisk-general mailing list >> Gpt...@li... >> https://lists.sourceforge.net/lists/listinfo/gptfdisk-general > > > _______________________________________________ > Gptfdisk-general mailing list > Gpt...@li... > https://lists.sourceforge.net/lists/listinfo/gptfdisk-general > -- Rod Smith rod...@ro... http://www.rodsbooks.com |
|
From: <u3...@ne...> - 2021-06-08 22:29:40
|
Replying to myself because I had time to prepare a patch for the manual page. Which is the simple work. In particular, because it doesn't address the code, that I hope will be written, for sgdisk --info=0. At 2021-06-07 03:30:50, u3...@ne... wrote: > Thank you for your work. > > 1) With some entries, such as for -N, --largest-new=num, the manual page > takes the burden of claryfing -a (--set-alignment). I suggest to take > the same approach for the references to the -A, -c, -t, and -u options > within the entry for -n, --new=partnum:start:end. > The following patch fixes only the above long options issue. --- a/gptfdisk-1.0.7/sgdisk.8 2021-03-11 00:45:56.000000000 +0000 +++ b/gptfdisk-1.0.7/sgdisk.8 2021-06-08 21:49:17.679338911 +0000 @@ -339,7 +339,8 @@ start of the largest available block for the start sector and the end of the same block for the end sector. A partnum value of 0 causes the program to use the first available partition number. Subsequent uses of the -\fI\-A\fR, \fI\-c\fR, \fI\-t\fR, and \fI\-u\fR options may also use +\fI\-A\fR (\fI\-\-attributes\fR), \fI\-c\fR (\fI\-\-change\-name\fR), \fI\-t\fR +(\fI\-\-typecode\fR), and \fI\-u\fR (\fI\-\-partition\-guid\fR) options may also use \fI0\fR to refer to the same partition. .TP -- u34 > 2) For the special partnum of 0, --info=0 will show detailed information > about what -n, --new=partnum:start:end will do with 0 partnum, and a > 0 start value. > > -- > u34 > > > _______________________________________________ > Gptfdisk-general mailing list > Gpt...@li... > https://lists.sourceforge.net/lists/listinfo/gptfdisk-general |
|
From: Rod S. <rod...@ro...> - 2021-06-08 17:16:28
|
On 6/8/21 12:21 PM, Erik Larsson wrote: > Hi, > > On 08-06-2021 18:16, Rod Smith wrote: >> On 6/8/21 10:54 AM, Christian Ehrhardt wrote: >>>> There aren't a lot of changes from 1.0.7 to the current >>>> state, but given that this is kind of important for big-endian systems, >>>> I'll release this change as 1.0.8 soon -- but I'll give it a day or two >>>> in case something else crops up. >>> Agreed, that little wait sounds wise. >>> I've indirectly also pulled IBM into the boat since they are kind of >>> the "master of big-endian things". >>> Maybe (but no promise) they have opinions/hints on this as well. >> I've been doing some searching to find a way to identify UCS-2 with >> swapped bytes, so that the program could fix this automatically when >> reading corrupted partition tables. (GPT technically uses UCS-2, not >> UTF-16, although the GPT fdisk code has a lot of references to UTF-16 >> because at one time I relied on an external UTF-16 library.) So far no >> luck. > > > This problem is impossible to solve perfectly, however I would think > that partition labels with characters outside the ASCII range are very > rare in practice so for a start one could check if the first byte is 0 > in every UCS-2 byte-pair. > If true, then it's almost certain that the label is in big endian (but I > would still ask the user to confirm that the big-endian interpretation > makes more sense). Rather than implement something that stands a chance of getting things badly wrong, I'm leaning toward either doing nothing so that users can manually change partition labels, if desired; or implement an option to let users explicitly select partitions to byte-swap their labels. Either approach enables users to fix problems as they're detected, with the second option providing some help to users in recovering the original intended partition labels. Because most disk tools don't use partition labels for anything important, I don't think it's critical that these problems be corrected automatically. OTOH, automatically "fixing" something that's not broken, because of an algorithm that's prone to false alarms, could be really annoying. > There are of course also some ranges that are reserved in Unicode that > can be used to detect that something might not be right with the > endianness and if we're limiting the allowed Unicode range to UCS-2 we > can exclude UTF-16 surrogate pair ranges (disallowing for instance the > poop emoji as a partition label). > > One could also check locality (text doesn't usually use characters from > all over the place in but stays within a few defined script ranges) and > there may also be statistical models based on the frequency that Unicode > characters occur in text, but that's probably taking it too far. :) > > Best regards, > > - Erik -- Rod Smith rod...@ro... http://www.rodsbooks.com |
|
From: Erik L. <cat...@gm...> - 2021-06-08 16:23:09
|
Hi, On 08-06-2021 18:16, Rod Smith wrote: > On 6/8/21 10:54 AM, Christian Ehrhardt wrote: >>> There aren't a lot of changes from 1.0.7 to the current >>> state, but given that this is kind of important for big-endian systems, >>> I'll release this change as 1.0.8 soon -- but I'll give it a day or two >>> in case something else crops up. >> Agreed, that little wait sounds wise. >> I've indirectly also pulled IBM into the boat since they are kind of >> the "master of big-endian things". >> Maybe (but no promise) they have opinions/hints on this as well. > I've been doing some searching to find a way to identify UCS-2 with > swapped bytes, so that the program could fix this automatically when > reading corrupted partition tables. (GPT technically uses UCS-2, not > UTF-16, although the GPT fdisk code has a lot of references to UTF-16 > because at one time I relied on an external UTF-16 library.) So far no luck. This problem is impossible to solve perfectly, however I would think that partition labels with characters outside the ASCII range are very rare in practice so for a start one could check if the first byte is 0 in every UCS-2 byte-pair. If true, then it's almost certain that the label is in big endian (but I would still ask the user to confirm that the big-endian interpretation makes more sense). There are of course also some ranges that are reserved in Unicode that can be used to detect that something might not be right with the endianness and if we're limiting the allowed Unicode range to UCS-2 we can exclude UTF-16 surrogate pair ranges (disallowing for instance the poop emoji as a partition label). One could also check locality (text doesn't usually use characters from all over the place in but stays within a few defined script ranges) and there may also be statistical models based on the frequency that Unicode characters occur in text, but that's probably taking it too far. Best regards, - Erik |
|
From: Rod S. <rod...@ro...> - 2021-06-08 15:55:19
|
On 6/8/21 10:54 AM, Christian Ehrhardt wrote: > Hi Rod, > >> There aren't a lot of changes from 1.0.7 to the current >> state, but given that this is kind of important for big-endian systems, >> I'll release this change as 1.0.8 soon -- but I'll give it a day or two >> in case something else crops up. > > Agreed, that little wait sounds wise. > I've indirectly also pulled IBM into the boat since they are kind of > the "master of big-endian things". > Maybe (but no promise) they have opinions/hints on this as well. I've been doing some searching to find a way to identify UCS-2 with swapped bytes, so that the program could fix this automatically when reading corrupted partition tables. (GPT technically uses UCS-2, not UTF-16, although the GPT fdisk code has a lot of references to UTF-16 because at one time I relied on an external UTF-16 library.) So far no luck. -- Rod Smith rod...@ro... http://www.rodsbooks.com |
|
From: Christian E. <chr...@ca...> - 2021-06-08 14:54:54
|
Hi Rod, > There aren't a lot of changes from 1.0.7 to the current > state, but given that this is kind of important for big-endian systems, > I'll release this change as 1.0.8 soon -- but I'll give it a day or two > in case something else crops up. Agreed, that little wait sounds wise. I've indirectly also pulled IBM into the boat since they are kind of the "master of big-endian things". Maybe (but no promise) they have opinions/hints on this as well. |
|
From: Rod S. <rod...@ro...> - 2021-06-08 14:48:09
|
On 6/8/21 9:17 AM, Erik Larsson wrote: > Hi Christian, > > I have created a merge request to address the issue with big-endian > partition names: > https://sourceforge.net/p/gptfdisk/code/merge-requests/26/ Wow! I woke up to quite the flurry of activity on this. (I'm on the US East Coast.) Anyhow, thanks to both you and Christian for tracking this down and submitting the MR so quickly. I've accepted it, so if subsequent testing shows a need for more changes, please alert me and I'll handle it. There aren't a lot of changes from 1.0.7 to the current state, but given that this is kind of important for big-endian systems, I'll release this change as 1.0.8 soon -- but I'll give it a day or two in case something else crops up. > Please comment in there and test the state of the pull request to make > sure it works for you. We can discuss there what to do about existing > volumes. > > Best regards, > > - Erik > > >>>>>>>>> On 8.6.2021 10.12, Christian Ehrhardt wrote: >>>>>>>>>> Hi, >>>>>>>>>> I wanted to let you know that the recent try to fix big endian >>>>>>>>>> byte >>>>>>>>>> swapping is actually breaking big endian in 1.0.7. >>>>>>>>>> >>>>>>>>>> This is broken on s390x (=big endian) in Debian [1] and Ubuntu >>>>>>>>>> [2]. >>>>>>>>>> >>>>>>>>>> When you look at just these logs it seems it is just failing >>>>>>>>>> for no >>>>>>>>>> apparent reason, >>>>>>>>>> but with -x enabled in gdisk_test.sh one quickly sees there is >>>>>>>>>> some >>>>>>>>>> string-mangling happening: >>>>>>>>>> >>>>>>>>>> Number Start (sector) End (sector) Size Code Name >>>>>>>>>> 1 2048 131038 63.0 MiB 8300 >>>>>>>>>> 䰀椀渀甀砀 昀椀氀攀猀礀猀琀攀洀 >>>>>>>>>> >>>>>>>>>> Reading the very same file with the old gdisk is good - so likely >>>>>>>>>> the >>>>>>>>>> on-dis content is good as well: >>>>>>>>>> Number Start (sector) End (sector) Size Code Name >>>>>>>>>> 1 2048 131038 63.0 MiB 8300 Linux >>>>>>>>>> filesystem >>>>>>>>>> >>>>>>>>>> This is caused by GPTPart::GetDescription due to this change [3] >>>>>>>>>> in 1.0.7 >>>>>>>>>> >>>>>>>>>> Reverting this fixes change fixes the problem. >>>>>>>>>> >>>>>>>>>> [1]: >>>>>>>>>> https://buildd.debian.org/status/fetch.php?pkg=gdisk&arch=s390x&ver=1.0.7-1&stamp=1617791278&raw=0 >>>>>>>>>> >>>>>>>>>> [2]: >>>>>>>>>> https://launchpadlibrarian.net/540613637/buildlog_ubuntu-impish-s390x.gdisk_1.0.7-1_BUILDING.txt.gz >>>>>>>>>> >>>>>>>>>> [3]: >>>>>>>>>> https://sourceforge.net/p/gptfdisk/code/ci/86dd5fea351a5a55bea26b7622eb85ebd6075a60/ >>>>>>>>>> >>>>>>>>>> >>>>>> >>> >>> >>> -- >>> Christian Ehrhardt >>> Staff Engineer, Ubuntu Server >>> Canonical Ltd >> >> > > > _______________________________________________ > Gptfdisk-general mailing list > Gpt...@li... > https://lists.sourceforge.net/lists/listinfo/gptfdisk-general -- Rod Smith rod...@ro... http://www.rodsbooks.com |
|
From: Christian E. <chr...@ca...> - 2021-06-08 13:38:39
|
... > > 1152 bytes (1.2 kB, 1.1 KiB) copied, 3.3789e-05 s, 34.1 MB/s > > 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ > > In my experience the RHEL version of gdisk / sgdisk was just as broken > as the Ubuntu ones. > > I have created a merge request to address the issue with big-endian > partition names: > https://sourceforge.net/p/gptfdisk/code/merge-requests/26/ > > Please comment in there and test the state of the pull request to make > sure it works for you. We can discuss there what to do about existing > volumes. I've tested that solution and it works for me. I've commented on that MR and yes we can move the further discussion there. |
|
From: Erik L. <cat...@gm...> - 2021-06-08 13:18:12
|
Hi Christian, On 08-06-2021 15:59, Christian Ehrhardt wrote: > On Tue, Jun 8, 2021 at 2:34 PM Christian Ehrhardt > <chr...@ca...> wrote: >> ... >> >>> This was a thought error. I meant most significant byte, not least. :) >> not a problem, the examples were more important anyway >> >>>> -------- >>>> $ dd if=tmp/test1.0.6 bs=$[1024+128] count=1 | xxd -a >> ... >>>> 00000430: 0000 0000 0000 0000 004c 0069 006e 0075 .........L.i.n.u >>>> 00000440: 0078 0020 0066 0069 006c 0065 0073 0079 .x. .f.i.l.e.s.y >>>> 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ >> Yes, thanks for the command I was able to confirm that. >> >> ... >> >>>> Another indicator that there's something wrong is that GNU parted >>>> doesn't print the label: >> oO :-/ >> ... >> >>>> If sgdisk created these partition layouts, then there's clearly a bug >>>> in sgdisk which makes it write labels characters in big-endian format >>>> without byteswapping them. >> Indeed - gdisk exposes the same issue when creating partition labels >> as the test of gdisk was what initially made me look at this. >> I guess they share the underlying code anyway. >> >> I'm slightly scared as that means the gdisk we have in the field - >> potentially for quite a while - was labeling the wrong way. >> I'm somewhat afraid how to handle the disk/images that have already >> written tables as the fix to the display function will make it show >> the mangled data. >> >> To get a feeling I was checking this through all kinds of past >> releases and architectures. >> It seems to only affect s390x, but there all Ubuntu release up until >> 16.04 are affected the same way. >> That matches gdisk versions 1.0.1 - 1.0.7 >> For example: >> >> $ lxc exec testkvm-xenial-to -- bash -c "dd if=/dev/zero >> of=/tmp/mytest bs=1024 count=65536; sgdisk /tmp/mytest -o; sgdisk >> /tmp/mytest -n 1 -c '1:Linux filesystem' -t 1:8300; dd if=/tmp/mytest >> bs=$[1024+128] count=1 | xxd -a | grep 't.e.m'" >> ... >> 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ >> >> Well let us find the root cause and fix first and then think about >> what we could do to handle past issues any better. >> Since we don't have any specific delta on top of gdisk I wonder why >> "our" gdisk would be affected but not the one of RH8.3 that you were >> testing. > I didn't have RH8.3, but fedora 34 which also has gdisk 1.0.7 > That behaves just as broken as all the Ubuntu systems I've checked. > > [root@f34-s390x ~]# dd if=/dev/zero of=/tmp/mytest bs=1024 > count=65536; sgdisk /tmp/mytest -o; sgdisk /tmp/mytest -n 1 -c > '1:Linux filesystem' -t 1:8300; dd if=/tmp/mytest bs=$[1024+128] > count=1 | xxd -a | grep 't.e.m' > 65536+0 records in > 65536+0 records out > 67108864 bytes (67 MB, 64 MiB) copied, 0.087469 s, 767 MB/s > Creating new GPT entries in memory. > Warning: The kernel is still using the old partition table. > The new table will be used at the next reboot or after you > run partprobe(8) or kpartx(8) > The operation has completed successfully. > Setting name! > partNum is 0 > Warning: The kernel is still using the old partition table. > The new table will be used at the next reboot or after you > run partprobe(8) or kpartx(8) > The operation has completed successfully. > 1+0 records in > 1+0 records out > 1152 bytes (1.2 kB, 1.1 KiB) copied, 3.3789e-05 s, 34.1 MB/s > 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ In my experience the RHEL version of gdisk / sgdisk was just as broken as the Ubuntu ones. I have created a merge request to address the issue with big-endian partition names: https://sourceforge.net/p/gptfdisk/code/merge-requests/26/ Please comment in there and test the state of the pull request to make sure it works for you. We can discuss there what to do about existing volumes. Best regards, - Erik >>>>>>>> On 8.6.2021 10.12, Christian Ehrhardt wrote: >>>>>>>>> Hi, >>>>>>>>> I wanted to let you know that the recent try to fix big endian byte >>>>>>>>> swapping is actually breaking big endian in 1.0.7. >>>>>>>>> >>>>>>>>> This is broken on s390x (=big endian) in Debian [1] and Ubuntu [2]. >>>>>>>>> >>>>>>>>> When you look at just these logs it seems it is just failing for no >>>>>>>>> apparent reason, >>>>>>>>> but with -x enabled in gdisk_test.sh one quickly sees there is some >>>>>>>>> string-mangling happening: >>>>>>>>> >>>>>>>>> Number Start (sector) End (sector) Size Code Name >>>>>>>>> 1 2048 131038 63.0 MiB 8300 >>>>>>>>> 䰀椀渀甀砀 昀椀氀攀猀礀猀琀攀洀 >>>>>>>>> >>>>>>>>> Reading the very same file with the old gdisk is good - so likely >>>>>>>>> the >>>>>>>>> on-dis content is good as well: >>>>>>>>> Number Start (sector) End (sector) Size Code Name >>>>>>>>> 1 2048 131038 63.0 MiB 8300 Linux >>>>>>>>> filesystem >>>>>>>>> >>>>>>>>> This is caused by GPTPart::GetDescription due to this change [3] >>>>>>>>> in 1.0.7 >>>>>>>>> >>>>>>>>> Reverting this fixes change fixes the problem. >>>>>>>>> >>>>>>>>> [1]: >>>>>>>>> https://buildd.debian.org/status/fetch.php?pkg=gdisk&arch=s390x&ver=1.0.7-1&stamp=1617791278&raw=0 >>>>>>>>> [2]: >>>>>>>>> https://launchpadlibrarian.net/540613637/buildlog_ubuntu-impish-s390x.gdisk_1.0.7-1_BUILDING.txt.gz >>>>>>>>> [3]: >>>>>>>>> https://sourceforge.net/p/gptfdisk/code/ci/86dd5fea351a5a55bea26b7622eb85ebd6075a60/ >>>>>>>>> >>>>> >> >> >> -- >> Christian Ehrhardt >> Staff Engineer, Ubuntu Server >> Canonical Ltd > > |
|
From: Christian E. <chr...@ca...> - 2021-06-08 13:00:37
|
On Tue, Jun 8, 2021 at 2:34 PM Christian Ehrhardt <chr...@ca...> wrote: > > ... > > > This was a thought error. I meant most significant byte, not least. :) > > not a problem, the examples were more important anyway > > > > -------- > > > $ dd if=tmp/test1.0.6 bs=$[1024+128] count=1 | xxd -a > ... > > > 00000430: 0000 0000 0000 0000 004c 0069 006e 0075 .........L.i.n.u > > > 00000440: 0078 0020 0066 0069 006c 0065 0073 0079 .x. .f.i.l.e.s.y > > > 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ > > Yes, thanks for the command I was able to confirm that. > > ... > > > > Another indicator that there's something wrong is that GNU parted > > > doesn't print the label: > > oO :-/ > ... > > > > If sgdisk created these partition layouts, then there's clearly a bug > > > in sgdisk which makes it write labels characters in big-endian format > > > without byteswapping them. > > Indeed - gdisk exposes the same issue when creating partition labels > as the test of gdisk was what initially made me look at this. > I guess they share the underlying code anyway. > > I'm slightly scared as that means the gdisk we have in the field - > potentially for quite a while - was labeling the wrong way. > I'm somewhat afraid how to handle the disk/images that have already > written tables as the fix to the display function will make it show > the mangled data. > > To get a feeling I was checking this through all kinds of past > releases and architectures. > It seems to only affect s390x, but there all Ubuntu release up until > 16.04 are affected the same way. > That matches gdisk versions 1.0.1 - 1.0.7 > For example: > > $ lxc exec testkvm-xenial-to -- bash -c "dd if=/dev/zero > of=/tmp/mytest bs=1024 count=65536; sgdisk /tmp/mytest -o; sgdisk > /tmp/mytest -n 1 -c '1:Linux filesystem' -t 1:8300; dd if=/tmp/mytest > bs=$[1024+128] count=1 | xxd -a | grep 't.e.m'" > ... > 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ > > Well let us find the root cause and fix first and then think about > what we could do to handle past issues any better. > Since we don't have any specific delta on top of gdisk I wonder why > "our" gdisk would be affected but not the one of RH8.3 that you were > testing. I didn't have RH8.3, but fedora 34 which also has gdisk 1.0.7 That behaves just as broken as all the Ubuntu systems I've checked. [root@f34-s390x ~]# dd if=/dev/zero of=/tmp/mytest bs=1024 count=65536; sgdisk /tmp/mytest -o; sgdisk /tmp/mytest -n 1 -c '1:Linux filesystem' -t 1:8300; dd if=/tmp/mytest bs=$[1024+128] count=1 | xxd -a | grep 't.e.m' 65536+0 records in 65536+0 records out 67108864 bytes (67 MB, 64 MiB) copied, 0.087469 s, 767 MB/s Creating new GPT entries in memory. Warning: The kernel is still using the old partition table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) The operation has completed successfully. Setting name! partNum is 0 Warning: The kernel is still using the old partition table. The new table will be used at the next reboot or after you run partprobe(8) or kpartx(8) The operation has completed successfully. 1+0 records in 1+0 records out 1152 bytes (1.2 kB, 1.1 KiB) copied, 3.3789e-05 s, 34.1 MB/s 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ > > Best regards, > > > > -Erik > > > > >>>>> On 8.6.2021 10.12, Christian Ehrhardt wrote: > > >>>>>> Hi, > > >>>>>> I wanted to let you know that the recent try to fix big endian byte > > >>>>>> swapping is actually breaking big endian in 1.0.7. > > >>>>>> > > >>>>>> This is broken on s390x (=big endian) in Debian [1] and Ubuntu [2]. > > >>>>>> > > >>>>>> When you look at just these logs it seems it is just failing for no > > >>>>>> apparent reason, > > >>>>>> but with -x enabled in gdisk_test.sh one quickly sees there is some > > >>>>>> string-mangling happening: > > >>>>>> > > >>>>>> Number Start (sector) End (sector) Size Code Name > > >>>>>> 1 2048 131038 63.0 MiB 8300 > > >>>>>> 䰀椀渀甀砀 昀椀氀攀猀礀猀琀攀洀 > > >>>>>> > > >>>>>> Reading the very same file with the old gdisk is good - so likely > > >>>>>> the > > >>>>>> on-dis content is good as well: > > >>>>>> Number Start (sector) End (sector) Size Code Name > > >>>>>> 1 2048 131038 63.0 MiB 8300 Linux > > >>>>>> filesystem > > >>>>>> > > >>>>>> This is caused by GPTPart::GetDescription due to this change [3] > > >>>>>> in 1.0.7 > > >>>>>> > > >>>>>> Reverting this fixes change fixes the problem. > > >>>>>> > > >>>>>> [1]: > > >>>>>> https://buildd.debian.org/status/fetch.php?pkg=gdisk&arch=s390x&ver=1.0.7-1&stamp=1617791278&raw=0 > > >>>>>> [2]: > > >>>>>> https://launchpadlibrarian.net/540613637/buildlog_ubuntu-impish-s390x.gdisk_1.0.7-1_BUILDING.txt.gz > > >>>>>> [3]: > > >>>>>> https://sourceforge.net/p/gptfdisk/code/ci/86dd5fea351a5a55bea26b7622eb85ebd6075a60/ > > >>>>>> > > >>>> > > >> > > >> > > > > -- > Christian Ehrhardt > Staff Engineer, Ubuntu Server > Canonical Ltd -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd |
|
From: Christian E. <chr...@ca...> - 2021-06-08 12:35:30
|
... > This was a thought error. I meant most significant byte, not least. :) not a problem, the examples were more important anyway > > -------- > > $ dd if=tmp/test1.0.6 bs=$[1024+128] count=1 | xxd -a ... > > 00000430: 0000 0000 0000 0000 004c 0069 006e 0075 .........L.i.n.u > > 00000440: 0078 0020 0066 0069 006c 0065 0073 0079 .x. .f.i.l.e.s.y > > 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ Yes, thanks for the command I was able to confirm that. ... > > Another indicator that there's something wrong is that GNU parted > > doesn't print the label: oO :-/ ... > > If sgdisk created these partition layouts, then there's clearly a bug > > in sgdisk which makes it write labels characters in big-endian format > > without byteswapping them. Indeed - gdisk exposes the same issue when creating partition labels as the test of gdisk was what initially made me look at this. I guess they share the underlying code anyway. I'm slightly scared as that means the gdisk we have in the field - potentially for quite a while - was labeling the wrong way. I'm somewhat afraid how to handle the disk/images that have already written tables as the fix to the display function will make it show the mangled data. To get a feeling I was checking this through all kinds of past releases and architectures. It seems to only affect s390x, but there all Ubuntu release up until 16.04 are affected the same way. That matches gdisk versions 1.0.1 - 1.0.7 For example: $ lxc exec testkvm-xenial-to -- bash -c "dd if=/dev/zero of=/tmp/mytest bs=1024 count=65536; sgdisk /tmp/mytest -o; sgdisk /tmp/mytest -n 1 -c '1:Linux filesystem' -t 1:8300; dd if=/tmp/mytest bs=$[1024+128] count=1 | xxd -a | grep 't.e.m'" ... 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ Well let us find the root cause and fix first and then think about what we could do to handle past issues any better. Since we don't have any specific delta on top of gdisk I wonder why "our" gdisk would be affected but not the one of RH8.3 that you were testing. > Best regards, > > -Erik > > >>>>> On 8.6.2021 10.12, Christian Ehrhardt wrote: > >>>>>> Hi, > >>>>>> I wanted to let you know that the recent try to fix big endian byte > >>>>>> swapping is actually breaking big endian in 1.0.7. > >>>>>> > >>>>>> This is broken on s390x (=big endian) in Debian [1] and Ubuntu [2]. > >>>>>> > >>>>>> When you look at just these logs it seems it is just failing for no > >>>>>> apparent reason, > >>>>>> but with -x enabled in gdisk_test.sh one quickly sees there is some > >>>>>> string-mangling happening: > >>>>>> > >>>>>> Number Start (sector) End (sector) Size Code Name > >>>>>> 1 2048 131038 63.0 MiB 8300 > >>>>>> 䰀椀渀甀砀 昀椀氀攀猀礀猀琀攀洀 > >>>>>> > >>>>>> Reading the very same file with the old gdisk is good - so likely > >>>>>> the > >>>>>> on-dis content is good as well: > >>>>>> Number Start (sector) End (sector) Size Code Name > >>>>>> 1 2048 131038 63.0 MiB 8300 Linux > >>>>>> filesystem > >>>>>> > >>>>>> This is caused by GPTPart::GetDescription due to this change [3] > >>>>>> in 1.0.7 > >>>>>> > >>>>>> Reverting this fixes change fixes the problem. > >>>>>> > >>>>>> [1]: > >>>>>> https://buildd.debian.org/status/fetch.php?pkg=gdisk&arch=s390x&ver=1.0.7-1&stamp=1617791278&raw=0 > >>>>>> [2]: > >>>>>> https://launchpadlibrarian.net/540613637/buildlog_ubuntu-impish-s390x.gdisk_1.0.7-1_BUILDING.txt.gz > >>>>>> [3]: > >>>>>> https://sourceforge.net/p/gptfdisk/code/ci/86dd5fea351a5a55bea26b7622eb85ebd6075a60/ > >>>>>> > >>>> > >> > >> -- Christian Ehrhardt Staff Engineer, Ubuntu Server Canonical Ltd |
|
From: Erik L. <cat...@gm...> - 2021-06-08 11:39:31
|
Hi, Just some minor corrections that I felt compelled to do because of an embarassing thought error. They're inlined below... On 8.6.2021 14.32, Erik Larsson wrote: > Hi Christian, > > On 8.6.2021 13.47, Christian Ehrhardt wrote: >> On Tue, Jun 8, 2021 at 12:20 PM Erik Larsson <cat...@gm...> >> wrote: >>> On 8.6.2021 10.35, Christian Ehrhardt wrote: >>>> On Tue, Jun 8, 2021 at 9:24 AM Erik Larsson <cat...@gm...> >>>> wrote: > <snip> >>>> I'd think the fastest way for you could be getting a free s390x VM to >>>> work on via >>>> https://developer.ibm.com/components/ibm-linuxone/gettingstarted/# >>> >>> Thanks for the pointer! That was very helpful, I was able to get an >>> s390x VM up and running pretty quickly. >>> Unfortunately they do not offer Ubuntu specifically but I fired up a >>> RHEL8.3 VM to do the testing. >> Worst case (if needed) a Ubuntu/Debian container on that RH8.3 should >> do it. > > Good point, I could try that. > >>>>> and find out what's going on. I have no access to an s390x machine >>>>> but >>>>> maybe qemu can help with that... >>>> It can, but you'd want to use a rather new qemu and an older >>>> Debian/Ubuntu system as too recent instructions always are a problem. >>>> As I said the community cloud likely is your quickest way out of this. >>> >>> Indeed it was the quickest way. I have now compiled gptfdisk from >>> source >>> on the s390x instance and compared it against the bundled 'gdisk' on >>> RHEL8.3. >>> I used a GPT sample image that I created with the 'gpt' utility in >>> macOS, just to make sure it's untouched by the gdisk utility on any >>> platform. >>> It has 8 partitions with the phrase "File system" in various different >>> languages as GPT partition labels (for testing Unicode chars). >>> >>> I uploaded the image here: >>> https://catacombae.org/temp/gpttest.img.bz2 >>> >>> I am however getting the same results as I got on my PowerPC setup. >>> >>> With the RHEL8.3-provided gdisk 1.0.3: >>> -------- >>> $ uname -a >>> Linux catacombaetest 4.18.0-305.3.1.el8_4.s390x #1 SMP Mon May 17 >>> 10:16:29 EDT 2021 s390x s390x s390x GNU/Linux >>> $ sudo gdisk /dev/loop1 >>> GPT fdisk (gdisk) version 1.0.3 >>> >>> Partition table scan: >>> MBR: protective >>> BSD: not present >>> APM: not present >>> GPT: present >>> >>> Found valid GPT with protective MBR; using GPT. >>> >>> Command (? for help): p >>> Disk /dev/loop1: 262144 sectors, 128.0 MiB >>> Sector size (logical/physical): 512/512 bytes >>> Disk identifier (GUID): A4FE502F-C264-4D51-920B-3849BB696BA7 >>> Partition table holds up to 128 entries >>> Main partition table begins at sector 2 and ends at sector 33 >>> First usable sector is 34, last usable sector is 262110 >>> Partitions will be aligned on 2-sector boundaries >>> Total free space is 98237 sectors (48.0 MiB) >>> >>> Number Start (sector) End (sector) Size Code Name >>> 1 34 20513 10.0 MiB 0700 >>> 䘀椀氀攀 猀礀猀琀攀洀 >>> 2 20514 40993 10.0 MiB 0700 >>> ꌃ촃쌃쐃뜃밃넃 넃섃윃딃꼃줃봃 >>> 3 40994 61473 10.0 MiB 0700 蝥ﭼ >>> 4 61474 81953 10.0 MiB 0700 >>> ␄〄㤄㬄㸄㈄〄伄 䄄㠄䄄䈄㔄㰄〄 >>> 5 81954 102433 10.0 MiB 0700 >>> 䘆㠆✆䔆 ✆䐆䔆䐆䄆✆⨆ >>> 6 102434 122913 10.0 MiB 0700 >>> ⬉㸉܉㈉ 㠉㼉㠉䴉Ἁ⸉ >>> 7 122914 143393 10.0 MiB 0700 >>> 8 143394 163873 10.0 MiB 0700 >>> 锋ꌋ뼋꼋锋촋锋쬋ꨋ촋ꨋ섋 긋섋넋젋긋젋 >>> >>> Command (? for help): q >>> -------- >>> >>> It's all garbage. However with the patched and freshly compiled gdisk >>> 1.0.7 straight from git: >>> >>> -------- >>> $ uname -a >>> Linux catacombaetest 4.18.0-305.3.1.el8_4.s390x #1 SMP Mon May 17 >>> 10:16:29 EDT 2021 s390x s390x s390x GNU/Linux >>> $ sudo ./gdisk /dev/loop1 >>> GPT fdisk (gdisk) version 1.0.7 >>> >>> Partition table scan: >>> MBR: protective >>> BSD: not present >>> APM: not present >>> GPT: present >>> >>> Found valid GPT with protective MBR; using GPT. >>> >>> Command (? for help): p >>> Disk /dev/loop1: 262144 sectors, 128.0 MiB >>> Sector size (logical/physical): 512/512 bytes >>> Disk identifier (GUID): A4FE502F-C264-4D51-920B-3849BB696BA7 >>> Partition table holds up to 128 entries >>> Main partition table begins at sector 2 and ends at sector 33 >>> First usable sector is 34, last usable sector is 262110 >>> Partitions will be aligned on 2-sector boundaries >>> Total free space is 98237 sectors (48.0 MiB) >>> >>> Number Start (sector) End (sector) Size Code Name >>> 1 34 20513 10.0 MiB 0700 File system >>> 2 20514 40993 10.0 MiB 0700 Σύστημα >>> αρχείων >>> 3 40994 61473 10.0 MiB 0700 文件系统 >>> 4 61474 81953 10.0 MiB 0700 Файловая >>> система >>> 5 81954 102433 10.0 MiB 0700 نظام الملفات >>> 6 102434 122913 10.0 MiB 0700 फाइल सिस्टम >>> 7 122914 143393 10.0 MiB 0700 טעקע סיסטעם >>> 8 143394 163873 10.0 MiB 0700 >>> கணியக்கோப்பு முறைமை >>> >>> Command (? for help): q >>> -------- >>> >>> With the version compiled from git including my fix it looks fine. All >>> characters are decoded properly. >>> >>> Would you be able to test this image on your Ubuntu s390x instance and >>> report back the results? >> Sure, I can do that >> >>> Or provide an image with a counterexample? >> And sure again, first a log, then cross tests and eventually the >> image files >> >> #1 1.0.6 >> >> $ dd if=/dev/zero of=/tmp/test1.0.6 bs=1024 count=65536 >> 65536+0 records in >> 65536+0 records out >> 67108864 bytes (67 MB, 64 MiB) copied, 0.154128 s, 435 MB/s >> $ gdisk-1.0.6/sgdisk /tmp/test1.6 -o >> Warning: Partition table header claims that the size of partition table >> entries is 0 bytes, but this program supports only 128-byte entries. >> Adjusting accordingly, but partition table may be garbage. >> Warning: Partition table header claims that the size of partition table >> entries is 0 bytes, but this program supports only 128-byte entries. >> Adjusting accordingly, but partition table may be garbage. >> Creating new GPT entries in memory. >> Warning: The kernel is still using the old partition table. >> The new table will be used at the next reboot or after you >> run partprobe(8) or kpartx(8) >> The operation has completed successfully. >> $ gdisk-1.0.6/sgdisk /tmp/test1.0.6 -n 1 -c '1:Linux filesystem' -t >> 1:8300 >> Setting name! >> partNum is 0 >> Warning: The kernel is still using the old partition table. >> The new table will be used at the next reboot or after you >> run partprobe(8) or kpartx(8) >> The operation has completed successfully. >> $ gdisk-1.0.6/gdisk -l /tmp/test1.0.6 >> GPT fdisk (gdisk) version 1.0.6 >> >> Partition table scan: >> MBR: protective >> BSD: not present >> APM: not present >> GPT: present >> >> Found valid GPT with protective MBR; using GPT. >> Disk /tmp/test1.0.6: 131072 sectors, 64.0 MiB >> Sector size (logical): 512 bytes >> Disk identifier (GUID): 970AC708-C718-4CDF-8EF4-1DCE94ADF8FB >> Partition table holds up to 128 entries >> Main partition table begins at sector 2 and ends at sector 33 >> First usable sector is 34, last usable sector is 131038 >> Partitions will be aligned on 2048-sector boundaries >> Total free space is 2014 sectors (1007.0 KiB) >> >> Number Start (sector) End (sector) Size Code Name >> 1 2048 131038 63.0 MiB 8300 Linux >> filesystem >> >> >> #1 1.0.7 >> >> dd if=/dev/zero of=/tmp/test1.0.7 bs=1024 count=65536 >> 65536+0 records in >> 65536+0 records out >> 67108864 bytes (67 MB, 64 MiB) copied, 0.190568 s, 352 MB/s >> gdisk-1.0.7/sgdisk /tmp/test1.0.7 -o >> Creating new GPT entries in memory. >> Warning: The kernel is still using the old partition table. >> The new table will be used at the next reboot or after you >> run partprobe(8) or kpartx(8) >> The operation has completed successfully. >> gdisk-1.0.7/sgdisk /tmp/test1.0.7 -n 1 -c '1:Linux filesystem' -t 1:8300 >> Setting name! >> partNum is 0 >> Warning: The kernel is still using the old partition table. >> The new table will be used at the next reboot or after you >> run partprobe(8) or kpartx(8) >> The operation has completed successfully. >> gdisk-1.0.7/gdisk -l /tmp/test1.0.7 >> GPT fdisk (gdisk) version 1.0.7 >> >> Partition table scan: >> MBR: protective >> BSD: not present >> APM: not present >> GPT: present >> >> Found valid GPT with protective MBR; using GPT. >> Disk /tmp/test1.0.7: 131072 sectors, 64.0 MiB >> Sector size (logical): 512 bytes >> Disk identifier (GUID): 14750985-A59C-451B-B0D1-A49614B866E2 >> Partition table holds up to 128 entries >> Main partition table begins at sector 2 and ends at sector 33 >> First usable sector is 34, last usable sector is 131038 >> Partitions will be aligned on 2048-sector boundaries >> Total free space is 2014 sectors (1007.0 KiB) >> >> Number Start (sector) End (sector) Size Code Name >> 1 2048 131038 63.0 MiB 8300 >> 䰀椀渀甀砀 昀椀氀攀猀礀猀琀攀洀 >> >> >> #3 cross tests >> >> #3.1 1.0.6 reading the 1.0.7 image >> >> $ gdisk-1.0.6/gdisk -l /tmp/test1.0.7 >> GPT fdisk (gdisk) version 1.0.6 >> >> Partition table scan: >> MBR: protective >> BSD: not present >> APM: not present >> GPT: present >> >> Found valid GPT with protective MBR; using GPT. >> Disk /tmp/test1.0.7: 131072 sectors, 64.0 MiB >> Sector size (logical): 512 bytes >> Disk identifier (GUID): 14750985-A59C-451B-B0D1-A49614B866E2 >> Partition table holds up to 128 entries >> Main partition table begins at sector 2 and ends at sector 33 >> First usable sector is 34, last usable sector is 131038 >> Partitions will be aligned on 2048-sector boundaries >> Total free space is 2014 sectors (1007.0 KiB) >> >> Number Start (sector) End (sector) Size Code Name >> 1 2048 131038 63.0 MiB 8300 Linux >> filesystem >> >> #3.2 1.0.7 reading the 1.0.6 image >> >> $ gdisk-1.0.7/gdisk -l /tmp/test1.0.6 >> GPT fdisk (gdisk) version 1.0.7 >> >> Partition table scan: >> MBR: protective >> BSD: not present >> APM: not present >> GPT: present >> >> Found valid GPT with protective MBR; using GPT. >> Disk /tmp/test1.0.6: 131072 sectors, 64.0 MiB >> Sector size (logical): 512 bytes >> Disk identifier (GUID): 970AC708-C718-4CDF-8EF4-1DCE94ADF8FB >> Partition table holds up to 128 entries >> Main partition table begins at sector 2 and ends at sector 33 >> First usable sector is 34, last usable sector is 131038 >> Partitions will be aligned on 2048-sector boundaries >> Total free space is 2014 sectors (1007.0 KiB) >> >> Number Start (sector) End (sector) Size Code Name >> 1 2048 131038 63.0 MiB 8300 >> 䰀椀渀甀砀 昀椀氀攀猀礀猀琀攀洀 >> >> >> These are the two image files that got created by the commands above: >> https://people.canonical.com/~paelzer/test1.0.6.tar.xz >> https://people.canonical.com/~paelzer/test1.0.7.tar.xz >> >> I hope that helps and let me know if you need anything else. > > Thanks for those images. Now it's much clearer what is going on. > Both your images have the on-disk volume label UTF-16 units in big > endian, not little endian which is mandated by the EFI specification! > > Just look at the first 1 KiB + 128 byte (first GPT entry) of the > volume how the characters in the string "Linux filesystem" are in > big-endian (least significant byte first): This was a thought error. I meant most significant byte, not least. :) > -------- > $ dd if=tmp/test1.0.6 bs=$[1024+128] count=1 | xxd -a > 00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > * > 000001c0: 0200 ee28 2008 0100 0000 ffff 0100 0000 ...( ........... > 000001d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > 000001e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U. > 00000200: 4546 4920 5041 5254 0000 0100 5c00 0000 EFI PART....\... > 00000210: 8b05 d554 0000 0000 0100 0000 0000 0000 ...T............ > 00000220: ffff 0100 0000 0000 2200 0000 0000 0000 ........"....... > 00000230: deff 0100 0000 0000 08c7 0a97 18c7 df4c ...............L > 00000240: 8ef4 1dce 94ad f8fb 0200 0000 0000 0000 ................ > 00000250: 8000 0000 8000 0000 880a f472 0000 0000 ...........r.... > 00000260: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > * > 00000400: af3d c60f 8384 7247 8e79 3d69 d847 7de4 .=....rG.y=i.G}. > 00000410: 4d33 25ac 07d6 794c 9bcf 50c5 4e86 fc72 M3%...yL..P.N..r > 00000420: 0008 0000 0000 0000 deff 0100 0000 0000 ................ > 00000430: 0000 0000 0000 0000 004c 0069 006e 0075 .........L.i.n.u > 00000440: 0078 0020 0066 0069 006c 0065 0073 0079 .x. .f.i.l.e.s.y > 00000450: 0073 0074 0065 006d 0000 0000 0000 0000 .s.t.e.m........ > 00000460: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > 00000470: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > -------- > > Compare this to the image I provided where the label characters ("File > system") are in little endian (most significant byte first): This was a thought error. I meant least significant byte, not most. :) > -------- > $ dd if=gpttest.img bs=$[1024+128] count=1 | xxd -a > 00000000: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > * > 000001b0: 0000 0000 0000 0000 0000 0000 0000 00ff ................ > 000001c0: ffff eeff ffff 0100 0000 ffff 0300 0000 ................ > 000001d0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > 000001e0: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > 000001f0: 0000 0000 0000 0000 0000 0000 0000 55aa ..............U. > 00000200: 4546 4920 5041 5254 0000 0100 5c00 0000 EFI PART....\... > 00000210: 7b79 7b6e 0000 0000 0100 0000 0000 0000 {y{n............ > 00000220: ffff 0300 0000 0000 2200 0000 0000 0000 ........"....... > 00000230: deff 0300 0000 0000 2f50 fea4 64c2 514d ......../P..d.QM > 00000240: 920b 3849 bb69 6ba7 0200 0000 0000 0000 ..8I.ik......... > 00000250: 8000 0000 8000 0000 6435 b972 0000 0000 ........d5.r.... > 00000260: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > * > 00000400: a2a0 d0eb e5b9 3344 87c0 68b6 b726 99c7 ......3D..h..&.. > 00000410: ceee 9eb1 b179 344b 89dc 7c7c 1b85 379e .....y4K..||..7. > 00000420: 2200 0000 0000 0000 2150 0000 0000 0000 ".......!P...... > 00000430: 0000 0000 0000 0000 4600 6900 6c00 6500 ........F.i.l.e. > 00000440: 2000 7300 7900 7300 7400 6500 6d00 0000 .s.y.s.t.e.m... > 00000450: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > 00000460: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > 00000470: 0000 0000 0000 0000 0000 0000 0000 0000 ................ > -------- > > > Another indicator that there's something wrong is that GNU parted > doesn't print the label: > -------- > $ losetup > NAME SIZELIMIT OFFSET AUTOCLEAR RO > BACK-FILE DIO LOG-SEC > /dev/loop1 0 0 0 1 > /home/linux1/gptfdisk/gpttest.img 0 512 > /dev/loop2 0 0 0 1 > /home/linux1/gptfdisk/tmp/test1.0.6 0 512 > /dev/loop0 0 0 0 0 > /var/opt/zthin/cfgdrive.iso 0 512 > /dev/loop3 0 0 0 1 > /home/linux1/gptfdisk/tmp/test1.0.7 0 512 > $ sudo parted /dev/loop2 > GNU Parted 3.2 > Using /dev/loop2 > Welcome to GNU Parted! Type 'help' to view a list of commands. > (parted) p > Model: Loopback device (loopback) > Disk /dev/loop2: 67.1MB > Sector size (logical/physical): 512B/512B > Partition Table: gpt > Disk Flags: > > Warning: failed to translate partition name > Number Start End Size File system Name Flags > 1 1049kB 67.1MB 66.0MB > > (parted) q > $ sudo parted /dev/loop1 > GNU Parted 3.2 > Using /dev/loop1 > Welcome to GNU Parted! Type 'help' to view a list of commands. > (parted) p > Model: Loopback device (loopback) > Disk /dev/loop1: 134MB > Sector size (logical/physical): 512B/512B > Partition Table: gpt > Disk Flags: > > Warning: failed to translate partition name > Warning: failed to translate partition name > Warning: failed to translate partition name > Warning: failed to translate partition name > Warning: failed to translate partition name > Warning: failed to translate partition name > Warning: failed to translate partition name > Number Start End Size File system Name Flags > 1 17.4kB 10.5MB 10.5MB File system msftdata > 2 10.5MB 21.0MB 10.5MB msftdata > 3 21.0MB 31.5MB 10.5MB msftdata > 4 31.5MB 42.0MB 10.5MB msftdata > 5 42.0MB 52.4MB 10.5MB msftdata > 6 52.4MB 62.9MB 10.5MB msftdata > 7 62.9MB 73.4MB 10.5MB msftdata > 8 73.4MB 83.9MB 10.5MB msftdata > > (parted) q > -------- > > (Clearly GNU parted doesn't like non-ASCII labels, but you can at > least see that the first label "File system" is printed.) > > If sgdisk created these partition layouts, then there's clearly a bug > in sgdisk which makes it write labels characters in big-endian format > without byteswapping them. Best regards, -Erik >>>>> On 8.6.2021 10.12, Christian Ehrhardt wrote: >>>>>> Hi, >>>>>> I wanted to let you know that the recent try to fix big endian byte >>>>>> swapping is actually breaking big endian in 1.0.7. >>>>>> >>>>>> This is broken on s390x (=big endian) in Debian [1] and Ubuntu [2]. >>>>>> >>>>>> When you look at just these logs it seems it is just failing for no >>>>>> apparent reason, >>>>>> but with -x enabled in gdisk_test.sh one quickly sees there is some >>>>>> string-mangling happening: >>>>>> >>>>>> Number Start (sector) End (sector) Size Code Name >>>>>> 1 2048 131038 63.0 MiB 8300 >>>>>> 䰀椀渀甀砀 昀椀氀攀猀礀猀琀攀洀 >>>>>> >>>>>> Reading the very same file with the old gdisk is good - so likely >>>>>> the >>>>>> on-dis content is good as well: >>>>>> Number Start (sector) End (sector) Size Code Name >>>>>> 1 2048 131038 63.0 MiB 8300 Linux >>>>>> filesystem >>>>>> >>>>>> This is caused by GPTPart::GetDescription due to this change [3] >>>>>> in 1.0.7 >>>>>> >>>>>> Reverting this fixes change fixes the problem. >>>>>> >>>>>> [1]: >>>>>> https://buildd.debian.org/status/fetch.php?pkg=gdisk&arch=s390x&ver=1.0.7-1&stamp=1617791278&raw=0 >>>>>> [2]: >>>>>> https://launchpadlibrarian.net/540613637/buildlog_ubuntu-impish-s390x.gdisk_1.0.7-1_BUILDING.txt.gz >>>>>> [3]: >>>>>> https://sourceforge.net/p/gptfdisk/code/ci/86dd5fea351a5a55bea26b7622eb85ebd6075a60/ >>>>>> >>>> >> >> |