-1

I was investigating blkid options and have trouble understanding the -O option.

user@host :~ $ > blkid --help | grep -E -- '-O'
 -O, --offset <offset>      probe at the given offset

What is this "offset" ?

For reference, On a virtual machine (with VirtualBox) with a VDI disk of 8GB, the biggest offset I can set before receiving the error message invalid offset argument: [...] : Numerical result out of range is :

[rootfs]# blkid -O 18446744073709551615

And it gives the same output as with blkid alone.

I first thought this would be the total number of sectors or bytes, but this above number does not correspond at all with either.

Atralb
  • 253
  • 2
  • 12

1 Answers1

-1

This option doesn't make any sense if you don't specify a device to work on. In a perfect world blkid -O 18446744073709551615 should just print something like,"-O offset requires an argument" and exit but it doesn't. You may file a bug report here https://bugz.fedoraproject.org/util-linux

From the man page:

-O, --offset offset
    Probe at the given offset (only useful with --probe).
    This option can be used together with the --info option.

This option won't work if not used properly with other required arguments.

Here's its output when used properly:

blkid -O 18446744073709551615 /dev/sda
/dev/sda: PTUUID="01abcdef" PTTYPE="dos"

It cannot actually read anything by this offset (it's 2^64-1), so it's reading from offset 0.

Artem S. Tashkinov
  • 26,392
  • 4
  • 33
  • 64