User Tools

Site Tools


btrfs

BTRFS

Finding out resume offset for swap hibernation in 32bit machine (i386)

The code “btrfs_map_physical.c” for finding out the swap file offset for hibernation resume doesn't work on 32bits.

Error messages:

error opening file for reading: Value too large for defined data type

or:

fstat: Value too large for defined data type

Change:

	fd = open(argv[optind], O_RDONLY);

For:

fd = open(argv[optind], O_RDONLY |O_LARGEFILE );

and compile using the following command line:

gcc -O2 -o btrfs_map_physical -D_FILE_OFFSET_BITS=64 btrfs_map_physical.c
btrfs.txt · Last modified: 2021/12/09 07:35 by 144.76.14.153