Re: [Gptfdisk-general] misreads NetBSD as FreeBSD
Brought to you by:
srs5694
From: Rod S. <rod...@ro...> - 2023-08-04 02:25:07
|
On 8/3/23 19:58, David Chmelik wrote: > On 8/3/23 6:59 AM, Rod Smith wrote: >> On 8/3/23 04:31, dch...@gm... wrote: >>> Lately I also use gdisk, etc. Unlike fdisk, gdisk misreads my NetBSD >>> partition as a FreeBSD one. >> >> There's a lot you haven't stated that's likely relevant. For instance, >> is the disk currently MBR or GPT? If the latter, was it once MBR, but >> was converted to GPT; and if so, by what program? Is the fdisk you're >> using from util-linux or based on libparted? What column(s) of output >> are you reading in both fdisk and gdisk? Because I don't know the >> answers to these questions, I can't give you an answer about what's >> going on; however, I can say this.... > I guess everything's fine then. The solid state drive (SSD/M2/NVME) is > currently MBR and I used fdisk from util-linux but also used it on *BSD > UNIX (which works differently). Yes, if the disk is MBR, then what you're seeing is the expected behavior, caused by the fact that there is (AFAIK) no direct GPT correlate to the MBR 0xA9 type code. GPT fdisk does the same thing with a number of type codes for NTFS and several FAT variants; they all get compressed down to GPT fdisk's 0700. > Thanks. I'd more likely reinstall everything on that drive if I had a > reason to convert to GPT, but I aliased fdisk to gdisk I STRONGLY recommend against doing this. Although I modeled gdisk's user interface on that for Linux fdisk, as this exchange has shown, gdisk is not completely compatible. I'd be especially worried about scripts that might try to parse fdisk's output, get it wrong, and do something disastrous as a result. Also, if you launch gdisk on an MBR disk and accidentally type "w", the result will be that the MBR partition table will be replaced by a GPT, which could cause serious problems. > because when I > got two new 16TB WD/HGST hard disc drives and used fdisk on them, it > seemed they were broken, and I didn't want to accidentally try a third. > Likely it wasn't fdisk causing it rather than just some decrease in > quality and a chance I got two bad ones. However now I type fdisk > (gdisk) or /sbin/fdisk (the real fdisk). Disk partitioning tools, including fdisk, gdisk, and parted, are unlikely to physically damage a disk. The worst they might do is to damage the partition table, or perhaps the contents of a partition. This is bad enough, of course, but it won't send a disk to a trash can; the disk should still be usable, after restoring it from a backup or using low-level recovery tools like PhotoRec. That said, if you distrust util-linux's fdisk, you could try replacing it with GNU fdisk (https://directory.fsf.org/wiki/Fdisk), which is based on libparted (the same library that underlies parted and GParted, among others). It's been a while since I've done anything with it, and I'm not even sure what Linux package(s) might hold it in common distributions; but it has a user interface that's similar to that of util-linux's fdisk, but completely different internals. -- Rod Smith rod...@ro... http://www.rodsbooks.com |