
On Wed, Oct 23, 2024 at 03:51:24PM -0500, CAREY SCHUG via talk wrote:
a partition table is just binary ones and zeros.
there are different kinds of partition tables.
it has to read the ones and zeros to determine if, or which kind of, partition table is there.
winblows reads those ones and zeros, determines it is NOT a partition table, but that it *IS* a filesystem.
If you put ext4 on a disk without partitions, windows would not recognize it had a filesystem. Windows can only do that because it recognized the filesystem type and knew what to do with it. Try connecting a drive with an Amiga FFS and see what windows does. Either nothing, or helpfully offers to format the drive for you to make it "usable". There are hundreds of possible filesystems you could put on there. Why (and even how) could parted know how to recignize them all? About the best it could do if you go to partition the drive is say 'hey the sector for the partition table is not all zero, are you sure you want to create a new partition table here?'
why is gparted too unwilling to do that?
Because it is an impossible task. There is no magic indicator that something is a filesystem. You need to check for the specific header layout of each particular filesystem to detect it. This is why the file tool has a database of magic signatures to recognize all sorts of things. Perhaps parted could instead ask file what it things is on the disk and display that. For example: lsorense@mythtv64:~$ sudo file -s /dev/sdh /dev/sdh: DOS/MBR boot sector lsorense@mythtv64:~$ sudo file -s /dev/sdg /dev/sdg: DOS/MBR boot sector; partition 1 : ID=0xee, start-CHS (0x0,0,2), end-CHS (0x3ff,255,63), startsector 1, 4294967295 sectors, extended partition table (last) lsorense@mythtv64:~$ sudo file -s /dev/sdg1 /dev/sdg1: Linux Software RAID version 1.2 (1) UUID=e0555ca7:7af8ef1c:d29d1583: e18e5a7 name=mythtv64:1 level=6 disks=9 lsorense@mythtv64:~$ sudo file -s /dev/sda1 /dev/sda1: Linux Software RAID version 1.2 (1) UUID=e0555ca7:7af8ef1c:d29d1583: e18e5a7 name=mythtv64:1 level=6 disks=9 lsorense@mythtv64:~$ sudo file -s /dev/sdf1 /dev/sdf1: Linux Software RAID version 1.2 (1) UUID=e0555ca7:7af8ef1c:d29d1583: e18e5a7 name=mythtv64:1 level=6 disks=9 lsorense@mythtv64:~$ sudo file -s /dev/sdh1 /dev/sdh1: Linux rev 1.0 ext4 filesystem data, UUID=85a0326e-99b6-4a83-9931-6a59cf36140f (needs journal recovery) (extents) (large files) (huge files) Took me a few tries to find one that wasn't a raid volume. :)
just as a safety mechanism. If I try to do something, is asks me several times, "are you sure?", all data will be wiped out. maybe if it can, it should warn me there is data on the disk that that will be wiped out if I make any changes.
maybe I'm confused on details.
is there a function in gparted to figure out what is on the disk?
I don't think so. It's just is just to display, create and modify various partition table formats. Filesystems and data are outside it's scope. It tries to follow the unix philosophy of doing one thing well.
Maybe I need to invoke such an option. or is it a different program?
As you see, file is good at telling what things are. -- Len Sorensen