From 109a229b42c101716d8a89ded4529e6f44f8ccf9 Mon Sep 17 00:00:00 2001 From: Jonas 'Sortie' Termansen Date: Fri, 27 Apr 2018 14:30:35 +0200 Subject: [PATCH] The Master Boot Record counts numbers of 512 bytes rather than sectors. It seems that CD-ROMs with MBRs count number of 512 bytes rather than number of 2048-byte sectors. --- libmount/mbr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libmount/mbr.c b/libmount/mbr.c index b6ca93c0..5eda4ae4 100644 --- a/libmount/mbr.c +++ b/libmount/mbr.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015 Jonas 'Sortie' Termansen. + * Copyright (c) 2015, 2018 Jonas 'Sortie' Termansen. * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -87,7 +87,7 @@ blockdevice_get_partition_table_mbr(struct partition_table** pt_ptr, struct blockdevice* bdev) { *pt_ptr = NULL; - blksize_t logical_block_size = blockdevice_logical_block_size(bdev); + blksize_t logical_block_size = 512; if ( !blockdevice_check_reasonable_block_size(logical_block_size) ) return errno = EINVAL, PARTITION_ERROR_ERRNO; off_t device_size = blockdevice_size(bdev);