Bug 151405 (IT_72056) - Hal doesn't correctly handle GPT partition table
Summary: Hal doesn't correctly handle GPT partition table
Keywords:
Status: CLOSED WONTFIX
Alias: IT_72056
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: hal
Version: 4.0
Hardware: ia64
OS: Linux
medium
high
Target Milestone: ---
: ---
Assignee: John (J5) Palmieri
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-03-17 17:40 UTC by H.J. Lu
Modified: 2013-03-13 04:47 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-09-07 18:53:21 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description H.J. Lu 2005-03-17 17:40:56 UTC
My /etc/fstab has

# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/sda1               /boot/efi               vfat    defaults        0 0
none                    /dev/pts                devpts  gid=5,mode=620  0 0
none                    /dev/shm                tmpfs   defaults        0 0
LABEL=/                 /mnt/rhel3              ext3    defaults        1 2
LABEL=/export           /export                 ext3    defaults        1 2
LABEL=/redhat           /export/redhat          ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /sys                    sysfs   defaults        0 0
/dev/sda3               swap                    swap    defaults        0 0
/dev/scd0               /media/cdrom            auto   
pamconsole,exec,noauto,managed 0 0

My / entry

LABEL=/1                /                       ext3    defaults        1 1

is missing. When I did

# reboot

it failed at fsck during boot. It may have something to do with GPT partition:

[root@gnu-4 gcc]# parted /dev/sdb
GNU Parted 1.6.19
Copyright (C) 1998 - 2004 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 /dev/sdb
(parted) p
Disk geometry for /dev/sdb: 0.000-70007.196 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
1          0.017  10000.000  ext3
2      10000.000  20000.000  ext2
3      20000.000  70007.180  ext3
(parted) q
Information: Don't forget to update /etc/fstab, if necessary.

[root@gnu-4 gcc]# fdisk /dev/sdb

The number of cylinders for this disk is set to 8924.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 73.4 GB, 73407865856 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        8925    71687368+  ee  EFI GPT

Command (m for help): q

[root@gnu-4 gcc]# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sdb1             10079052   3690964   5876092  39% /
/dev/sda1               102182     45224     56958  45% /boot/efi
none                    501664         0    501664   0% /dev/shm
/dev/sda2             10079084   4865952   4701132  51% /mnt/rhel3
/dev/sdb3             50403196  17418564  32980536  35% /export
/dev/sda4             22828384   6202396  16621892  28% /export/redhat

Comment 1 H.J. Lu 2005-03-17 17:50:43 UTC
I put

/dev/sdb1               /                       ext3    defaults        1 1

in /etc/fstab as a workaround.

Comment 2 David Zeuthen 2005-03-17 18:31:12 UTC
This more sounds like an installer bug; was this during install?

FYI fstab-sync won't add entries to /etc/fstab if the drive is fixed; it only
works for hotpluggable and removable drives.

Comment 3 H.J. Lu 2005-03-17 20:09:15 UTC
I think it was after I added

LABEL=/                 /mnt/rhel3              ext3    defaults        1 2

to /etc/fstab and did

# mount -av

Next time when I rebooted machine, / entry was gone. lshal shows

udi = '/org/freedesktop/Hal/devices/block_d6abef0d-75c3-495d-b126-683a3b169d0a'
 volume.mount_point = '/'  (string)
  volume.policy.desired_mount_point = 'scsidisk'  (string)
  volume.policy.mount_filesystem = 'ext3'  (string)
  volume.policy.should_mount = false  (bool)
  info.udi =
'/org/freedesktop/Hal/devices/block_d6abef0d-75c3-495d-b126-683a3b169d0a'  (string)
  volume.partition.msdos_part_table_type = 238  (0xee)  (int)
  volume.size = 10485743104  (0x270ffbe00)  (uint64)
  volume.block_size = 512  (0x200)  (int)
  volume.num_blocks = 20479967  (0x1387fdf)  (int)
  volume.partition.number = 1  (0x1)  (int)
  volume.is_partition = true  (bool)
  volume.is_mounted = true  (bool)
  volume.is_disc = false  (bool)
  volume.uuid = 'd6abef0d-75c3-495d-b126-683a3b169d0a'  (string)
  volume.label = '/1'  (string)
  volume.fsversion = ''  (string)
  volume.fsusage = 'filesystem'  (string)
  volume.fstype = 'ext3'  (string)
  info.product = '/1'  (string)
  block.storage_device =
'/org/freedesktop/Hal/devices/block_ST373453LC-3HW2GQ6M00007521UMX3'  (string)
  block.minor = 17  (0x11)  (int)
  block.major = 8  (0x8)  (int)
  info.capabilities = 'block volume'  (string)
  info.category = 'volume'  (string)
  info.parent =
'/org/freedesktop/Hal/devices/block_ST373453LC-3HW2GQ6M00007521UMX3'  (string)
  block.device = '/dev/sdb1'  (string)
  block.is_volume = true  (bool)
  block.have_scanned = false  (bool)
  block.no_partitions = false  (bool)
  linux.sysfs_path_device = '/sys/block/sdb/sdb1'  (string)
  linux.sysfs_path = '/sys/block/sdb/sdb1'  (string)
  info.bus = 'block'  (string)

Comment 4 David Zeuthen 2005-03-17 20:22:35 UTC
fstab-sync will only remove entries if the 'managed' option is set so I don't
know why your /etc/fstab entry for LABEL=/1 was removed. 

IIRC, the fstab-sync shipped with RHEL4 prints messages to the /var/log/messages
logfile when it modifies the /etc/fstab file. So, to questions

 1. Is there anything there about fstab-sync removing the mount point
    for LABEL=/1?

 2. Are there entries for removing/adding the entry for /media/cdrom?
    (should be on every boot)


Comment 5 H.J. Lu 2005-03-17 20:29:54 UTC
There are

Mar 16 17:25:33 gnu-4 fstab-sync[3123]: removed all generated mount points
Mar 16 17:25:34 gnu-4 fstab-sync[3270]: added mount point /media/cdrom for /dev/scd0

My / entry has

  volume.policy.should_mount = false  (bool)
  volume.partition.msdos_part_table_type = 238  (0xee)  (int)

Comment 6 David Zeuthen 2005-03-17 20:45:16 UTC
As stated in comment 2 fstab-sync will not add an /etc/fstab entry for your
device that has LABEL=/1 - that is per design.  

If you manually add the entry to /etc/fstab is it still there after a reboot?

Comment 7 H.J. Lu 2005-03-17 20:51:41 UTC
When I added LABEL=/1 entry by hand, it was gone after hald started. It seems
that hald doesn't like my / partition.

Comment 8 David Zeuthen 2005-03-17 20:55:12 UTC
Please paste exactly the line that disappears.

After adding it, try running 'fstab-sync --clean'. Is it gone after that?


Comment 9 H.J. Lu 2005-03-25 01:58:36 UTC
I have 2 disks, sda and sdb, on my ia64 machine. The EFI partition is on
sda. My sdb has a GPT partition table:

[root@gnu-4 tools]# parted /dev/sdb
GNU Parted 1.6.19
Copyright (C) 1998 - 2004 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 /dev/sdb
(parted) p
Disk geometry for /dev/sdb: 0.000-70007.196 megabytes
Disk label type: gpt
Minor    Start       End     Filesystem  Name                  Flags
1          0.017  10000.000  ext3
2      10000.000  20000.000  ext2
3      20000.000  70007.180  ext3
(parted)

But fdisk sees it as

[root@gnu-4 tools]# fdisk /dev/sdb

The number of cylinders for this disk is set to 8924.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): p

Disk /dev/sdb: 73.4 GB, 73407865856 bytes
255 heads, 63 sectors/track, 8924 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1        8925    71687368+  ee  EFI GPT

But hal doesn't handle it right. It thinks my sdb1 as

  volume.policy.should_mount = false  (bool)
  volume.partition.msdos_part_table_type = 238  (0xee)  (int)
  volume.partition.number = 1  (0x1)  (int)

The fix is to make hal, or libraries used, to correctly handle GPT
partition, like parted.

Comment 10 H.J. Lu 2005-03-25 17:21:41 UTC
Can't hal just use libparted? It will reduce code duplication and handle
all types of partition tables correctly.

Comment 11 Jatin Nansi 2005-08-02 10:04:24 UTC
Any updates for this bug?

Comment 12 H.J. Lu 2005-08-02 15:37:43 UTC
Is anyone working on it? I can give it a try if no one is working on it.

Comment 19 Bob Johnson 2006-02-08 15:46:49 UTC
HJ at Intel - still need your help on this one.

Comment 20 H.J. Lu 2006-02-08 16:22:12 UTC
What kinds of help do you need?

Comment 21 Bob Johnson 2006-02-13 18:04:14 UTC
From Intel last year, reposting...

Can't hal just use libparted? It will reduce code duplication and handle
all types of partition tables correctly.



Comment 22 John (J5) Palmieri 2006-02-13 19:15:06 UTC
Upstream says that they will not move to libparted because it is a large change
and volume_id is far wider tested and deployed.  We are looking into patching
the internal libvolume_id to support GPT.

Comment 23 H.J. Lu 2006-02-13 19:27:23 UTC
Last time when I checked, libparted supported many more partition tables and
anaconda used pyparted which used libparted. I doubt libparted is less
tested than volume_id when dealing with partion tables.

Comment 29 RHEL Program Management 2006-08-18 17:47:08 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 30 David Zeuthen 2006-09-07 17:35:37 UTC
Hi,

I'm the upstream maintainer of HAL. It is true that the HAL shipped in RHEL4
doesn't handle GPT partition tables correctly insofar that the property

 volume.partition.msdos_part_table_type

is exported even for GPT partitions. This is minor issue only, because HAL still
gets the partitions right due to the fact that the kernel have a GPT partition
table scanner. And no software besides HAL itself uses the property
volume.partition.msdos_part_table_type so even if you hotplug a USB harddisk
with GPT things will still work.

It's also important to keep in mind that the HAL version in RHEL4 was never
designed to handle anything but removable and hotpluggable drives and media so
while it's certainly possible to add a new property, say
volume.partition.gpt_part_table_uuid it wouldn't buy you much.

As such, there is little incentive for adding this feature.

By the way, more sophisticated partition table scanning is planned for future
upstream HAL releases that will eventually be part of a RHEL release. Thanks.


Comment 31 RHEL Program Management 2006-09-07 18:53:26 UTC
Development Management has reviewed and declined this request.  You may appeal
this decision by reopening this request. 


Note You need to log in before you can comment on or make changes to this bug.