bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fwd: Bug#208184: The disk label can be corrupted]


From: Timshel Knoll
Subject: [Fwd: Bug#208184: The disk label can be corrupted]
Date: Tue, 02 Sep 2003 00:08:21 +1000

Hrm - I can verify this one! wierd ...
-- 
Timshel Knoll
Debian GNU/Linux Developer      http://www.debian.org/
SPI Contributing Member         http://www.spi-inc.org/
GnuPG:          1024D/DE3E8AA7 Timshel Knoll <address@hidden>
Fingerprint:    6ABC 91A9 E274 ED67 0E32  8F0F 5DFA 9391 DE3E 8AA7
--- Begin Message --- Subject: Bug#208184: The disk label can be corrupted Date: Mon, 1 Sep 2003 13:52:50 +0300 User-agent: Mutt/1.3.28i
Package: libparted1.6-0
Version: 1.6.5-1

Hi!

Attached you will find a compressed disk image bug.disk.  Here is how
you can corrupt its label:

$ parted bug.disk
Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
This program is free software, covered by the GNU General Public License.

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General 
Public License for more details.

Using /tmp/bug/bug.disk
(parted) p
Disk geometry for /tmp/bug/bug.disk: 0.000-14.636 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.016      0.875  primary
3          0.875      1.000  extended
8          0.876      0.890  logical
6          0.891      0.937  logical
7          0.938      0.938  logical
5          0.938      0.953  logical
2          1.000     14.625  primary
(parted) mkpart logical linux-swap 0.954 0.999
Error: Can't have overlapping partitions
(parted) q

This bug is in libparted rather than in parted as you can see from
this small C program:

#include <parted/parted.h>

int main() {
        PedDevice *dev;
        PedDisk *disk;
        PedPartition *part;
        dev = ped_device_get("bug.disk");
        disk = ped_disk_new(dev);
        part = ped_partition_new(disk,
                                 PED_PARTITION_LOGICAL,
                                 ped_file_system_type_get("linux-swap"),
                                 1952, 2047);
        ped_disk_print(disk);
        if (!ped_disk_check(disk)) return;
        ped_disk_add_partition(disk, part, ped_constraint_any(dev));
        ped_disk_print(disk);
        ped_disk_commit(disk);
}


Anton Zinoviev

Attachment: bug.disk.gz
Description: Binary data


--- End Message ---

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]