[Parted-maintainers] Bug#460153: GPT label loses partitions after reboot

Paul Szabo psz at maths.usyd.edu.au
Sun Jan 13 22:19:05 UTC 2008


Further testing shows that in fact there is something "wrong" with gpt
labels. Using parted and msdos label works fine; using gpt label the
partition table is damaged at reboot. Transcripts below.

I now wonder if the bug is in parted, or maybe something else damages
the partition table at boot time. Output of dmesg below also.

I get the same results with Debian parted 1.7.1 or my "own" version
1.8.7. - For this test I told the 3ware RAID controller to use single
disks, not all 8*750GB disks in one RAID5 array as I would really want,
so cfdisk or msdos labels would work on this reasonably sized disk.

Paul Szabo   psz at maths.usyd.edu.au   http://www.maths.usyd.edu.au/u/psz/
School of Mathematics and Statistics   University of Sydney    Australia

---


## Using msdos partition table, things work fine
# parted /dev/sda
GNU Parted 1.7.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel msdos                                                    
(parted) mkpart p 10G 20G                                                 
(parted) print free                                                       

Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
        32.3kB  10.0GB  10.0GB           Free Space        
 1      10.0GB  20.0GB  10.0GB  primary                    
        20.0GB  750GB   730GB            Free Space        

(parted) quit                                                             
# mkfs.ext3 /dev/sda1
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
1221632 inodes, 9767520 blocks
488376 blocks (5.00%) reserved for the super user
First data block=1
1193 block groups
8192 blocks per group, 8192 fragments per group
1024 inodes per group
Superblock backups stored on blocks: 
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553, 
        1024001, 1990657, 2809857, 5120001, 5971969

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 35 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
# mount /dev/sda1 /tmp/mnt
# echo msdos partition sda1 > /tmp/mnt/file
# umount /tmp/mnt
# shutdown -r now
# ...
# mount /dev/sda1 /tmp/mnt
# cat /tmp/mnt/file
msdos partition sda1
# umount /tmp/mnt

---


## Using gpt partition table, things do not work
# parted /dev/sda
GNU Parted 1.7.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel gpt                                                      
(parted) mkpart p 10G 20G                                                 
(parted) print free                                                       

Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End      Size     File system  Name  Flags
        17.4kB  10000MB  10000MB  Free Space              
 1      10.0GB  20.0GB   10.0GB                p          
        20.0GB  750GB    730GB    Free Space              

(parted) quit                                                             
# mkfs.ext3 /dev/sda1
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
1221632 inodes, 9765624 blocks
488281 blocks (5.00%) reserved for the super user
First data block=1
1193 block groups
8192 blocks per group, 8192 fragments per group
1024 inodes per group
Superblock backups stored on blocks: 
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553, 
        1024001, 1990657, 2809857, 5120001, 5971969

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
# mount /dev/sda1 /tmp/mnt
# echo gpt partition sda1 > /tmp/mnt/file
# umount /tmp/mnt
# shutdown -r now 
# ...
# mount /dev/sda1 /tmp/mnt
mount: you must specify the filesystem type
## So the partition did not survive... check parted output:
# parted /dev/sda
GNU Parted 1.7.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print free                                                       

Disk /dev/sda: 750GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number  Start   End      Size     File system  Name  Flags
        17.4kB  10000MB  10000MB  Free Space              
 1      10.0GB  20.0GB   10.0GB   ext3         p          
        20.0GB  750GB    730GB    Free Space              

(parted) quit                                                             
Information: Don't forget to update /etc/fstab, if necessary.             

## which seems "good", but in fact the table is damaged
## as shown by mkfs trying to write 732MB:
# mkfs.ext3 /dev/sda1
mke2fs 1.40-WIP (14-Nov-2006)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
91551744 inodes, 732410876 blocks
36620543 blocks (5.00%) reserved for the super user
First data block=1
89406 block groups
8192 blocks per group, 8192 fragments per group
1024 inodes per group
Superblock backups stored on blocks: 
        8193, 24577, 40961, 57345, 73729, 204801, 221185, 401409, 663553, 
        1024001, 1990657, 2809857, 5120001, 5971969, 17915905, 19668993, 
        25600001, 53747713, 128000001, 137682945, 161243137, 483729409, 
        640000001
... [pressed ctrl-C]

---


### dmesg shows same thing whether disk is msdos or gpt labelled:
...
3ware 9000 Storage Controller device driver for Linux v2.26.08.002-2.6.18.
ACPI: PCI Interrupt 0000:0a:00.0[A] -> GSI 16 (level, low) -> IRQ 16
PCI: Setting latency timer of device 0000:0a:00.0 to 64
scsi0 : 3ware 9000 Storage Controller
3w-9xxx: scsi0: Found a 3ware 9000 Storage Controller at 0xda300000, IRQ: 16.
3w-9xxx: scsi0: Firmware FE9X 3.08.00.016, BIOS BE9X 3.08.00.004, Ports: 8.
  Vendor: AMCC      Model: 9650SE-8LP DISK   Rev: 3.08
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: AMCC      Model: 9650SE-8LP DISK   Rev: 3.08
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: AMCC      Model: 9650SE-8LP DISK   Rev: 3.08
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: AMCC      Model: 9650SE-8LP DISK   Rev: 3.08
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: AMCC      Model: 9650SE-8LP DISK   Rev: 3.08
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: AMCC      Model: 9650SE-8LP DISK   Rev: 3.08
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: AMCC      Model: 9650SE-8LP DISK   Rev: 3.08
  Type:   Direct-Access                      ANSI SCSI revision: 05
  Vendor: AMCC      Model: 9650SE-8LP DISK   Rev: 3.08
  Type:   Direct-Access                      ANSI SCSI revision: 05
libata version 2.00 loaded.
SCSI device sda: 1464821760 512-byte hdwr sectors (749989 MB)
sda: Write Protect is off
sda: Mode Sense: 23 00 00 00
SCSI device sda: drive cache: none
SCSI device sda: 1464821760 512-byte hdwr sectors (749989 MB)
sda: Write Protect is off
sda: Mode Sense: 23 00 00 00
SCSI device sda: drive cache: none
 sda: sda1
sd 0:0:0:0: Attached scsi disk sda
SCSI device sdb: 1464821760 512-byte hdwr sectors (749989 MB)
...





More information about the Parted-maintainers mailing list