Bug 614404

Summary: [LTC 6.0 FEAT] 201252: parted support (GPT, etc) for 4K Byte Sector data disk
Product: Red Hat Enterprise Linux 6 Reporter: Mike Snitzer <msnitzer>
Component: partedAssignee: Brian Lane <bcl>
Status: CLOSED WORKSFORME QA Contact: yanfu,wang <yanwang>
Severity: high Docs Contact:
Priority: high    
Version: 6.1CC: bcl, borgan, bugproxy, caiqian, charles_rose, coughlan, cward, ddumas, ejratl, esandeen, hdegoede, jfeeney, jjarvis, jmoyer, kzak, kzhang, martinez, matt_domsch, meyering, mgahagan, peterm, pjones, rlerch, rwheeler, snagar, wwlinuxengineering, yanwang
Target Milestone: rcKeywords: FutureFeature
Target Release: 6.1   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: 463632
: 618062 (view as bug list) Environment:
Last Closed: 2011-01-11 11:21:33 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On: 487227, 539553    
Bug Blocks: 534151, 356741, 463632, 519834, 523313, 554529, 554559, 576381, 618062, 654869, 696265    

Description Mike Snitzer 2010-07-14 08:33:39 EDT
+++ This bug was initially created as a clone of Bug #463632 +++

=Comment: #0=================================================
Emily J. Ratliff <emilyr@us.ibm.com> - 2008-09-16 18:09 EDT
1. Feature Overview:
Feature Id:	[201252]
a. Name of Feature:	4K Byte Sector HDDs Support
b. Feature Description
The SCSI core disk driver appears to already have support for multiple sector sizes. Tools,
filesystem and other driver updates may be required to ensure the 4K sector size HDDs function and
perform correctly. Will need to confirm when 4k sector HDDs are available for testing. Adding a new
4K drive to a system will be the same as adding a 512 byte sector drive.

Additional Comments:	Validation only feature.

--- Additional comment from rwheeler@redhat.com on 2010-07-02 13:56:32 EDT ---

Can you provide specifics on the type of drive tested?

Thanks!

--- Additional comment from bugproxy@us.ibm.com on 2010-07-02 14:41:42 EDT ---

------- Comment From bigmach@us.ibm.com 2010-07-02 14:32 EDT-------
I must apologize - I thought the system I was using to test was running rhel6
beta2, but it was actually an earlier snapshot.  I upgraded to beta2 and
re-tested, and things appear to be somewhat better.  For one thing, parted no
longer hangs and allows me to put a msdos disklabel on the disk.  If I try to
put a GPT disklabel on it, I get Input/Output errors writing to the backup GPT
table, but if I ignore them parted appears to be willing to proceed using just
the primary table.  This suggests that the calculation of the end of the disk
may be incorrect in parted.  I no longer see the errors I reported in dmesg,
but instead I see "Bad block number requested", and I/O errors for high sector
numbers.

From /proc/scsi/scsi for the disk I'm using:

Host: scsi0 Channel: 00 Id: 02 Lun: 00
Vendor: IBM-ESXS Model: CBRCA300C3ETS0 N Rev: C370
Type:   Direct-Access                    ANSI  SCSI revision: 06

--- Additional comment from jmoyer@redhat.com on 2010-07-13 16:15:31 EDT ---

What is the size of the disk?  What are the expected number of sectors and what sector is parted trying to read?  I'd like to narrow down whether the problem is in the kernel misreporting the size or parted miscalculating an offset.

Thanks.

--- Additional comment from bugproxy@us.ibm.com on 2010-07-13 18:00:48 EDT ---

------- Comment From bigmach@us.ibm.com 2010-07-13 17:53 EDT-------
(In reply to comment #19)
> What is the size of the disk?  What are the expected number of sectors and what
> sector is parted trying to read?  I'd like to narrow down whether the problem
> is in the kernel misreporting the size or parted miscalculating an offset.

When the disk is plugged in, the kernel generates these messages:

sd 0:0:1:0: Attached scsi generic sg1 type 0
sd 0:0:1:0: [sdb] 73242188 4096-byte logical blocks: (300 GB/279 GiB)
sd 0:0:1:0: [sdb] Write Protect is off
sd 0:0:1:0: [sdb] Mode Sense: db 00 10 08
sd 0:0:1:0: [sdb] Write cache: disabled, read cache: enabled, supports DPO and FUA
sd 0:0:1:0: [sdb] 73242188 4096-byte logical blocks: (300 GB/279 GiB)
sdb: unknown partition table
sd 0:0:1:0: [sdb] 73242188 4096-byte logical blocks: (300 GB/279 GiB)
sd 0:0:1:0: [sdb] Attached SCSI disk

Then if I examine the disk with fdisk, I get this:

# fdisk -l /dev/sdb
Note: sector size is 4096 (not 512)

Disk /dev/sdb: 300.0 GB, 300000002048 bytes
255 heads, 63 sectors/track, 4559 cylinders
Units = cylinders of 16065 * 4096 = 65802240 bytes
Sector size (logical/physical): 4096 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk identifier: 0x00000000

Unfortunately I no longer seem to be able to run parted on the disk - earlier I was able to and that's when I saw the errors about reading the backup GPT table.  Now parted just hangs after printing the warning about the 4K sector size.  According to strace, it's hanging in fsync() just like before.
Comment 1 Hans de Goede 2010-07-20 03:47:00 EDT
Given the lack of hardware access for 4k *logical* sector disks, I don't think it is realistic to try and fix this for 6.0. Luckily these disks are not yet available to the generic public (which is also sort of the problem), so I think it is ok to move this to 6.1 .
Comment 2 Mike Snitzer 2010-07-20 08:58:18 EDT
We can avoid parted entirely given that 6.0 only supports "native" 4K devices for data volumes (non-root device).  My understanding is fdisk works perfectly well on "native" 4K devices (GPT included).

We should document the recommendation of fdisk for 4K data devices in the storage admin guide (and release notes).
Comment 4 Peter Jones 2010-12-09 16:51:30 EST
Mike, that doesn't make any sense at all.  The installer has to be able to initialize the disks, and it does so with parted.
Comment 6 Peter Jones 2011-01-11 11:21:33 EST
This seems to currently work for me on 6.0:

pjones8:~# parted /dev/sda
Warning: Device /dev/sda has a logical sector size of 4096.  Not all parts of
GNU Parted support this at the moment, and the working code is HIGHLY
EXPERIMENTAL.

GNU Parted 2.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel                                                          
New disk label type? gpt                                                  
Warning: The existing disk label on /dev/sda will be destroyed and all data on
this disk will be lost. Do you want to continue?
Yes/No? yes                                                               
(parted) p                                                                
Model: SEAGATE ST3146356SS (scsi)
Disk /dev/sda: 163GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt

Number  Start  End  Size  File system  Name  Flags

(parted) mkpart                                                           
Partition name?  []? "EFI System Partition"                               
File system type?  [ext2]? FAT
parted: invalid token: FAT
File system type?  [ext2]? fat16                                          
Start? 1049kB                                                             
End? 211MB                                                                
(parted) set 1 boot on                                                    
(parted) mkpart                                                           
Partition name?  []?                                                      
File system type?  [ext2]?                                                
Start? 211MB                                                              
End? 524MB                                                                
(parted) mkpart                                                           
Partition name?  []?                                                      
File system type?  [ext2]?                                                
Start? 735MB                                                              
End? 163GB                                                                
(parted) p                                                                
Model: SEAGATE ST3146356SS (scsi)
Disk /dev/sda: 163GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt

Number  Start   End    Size   File system  Name                  Flags
 1      1049kB  211MB  210MB               EFI System Partition  boot
 2      211MB   524MB  314MB
 3      735MB   163GB  162GB
(parted) q                                                                
Information: You may need to update /etc/fstab.                           

pjones8:~# parted /dev/sda
Warning: Device /dev/sda has a logical sector size of 4096.  Not all parts of
GNU Parted support this at the moment, and the working code is HIGHLY
EXPERIMENTAL.

GNU Parted 2.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p                                                                
Model: SEAGATE ST3146356SS (scsi)
Disk /dev/sda: 163GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt

Number  Start   End    Size   File system  Name                  Flags
 1      1049kB  211MB  210MB               EFI System Partition  boot
 2      211MB   524MB  314MB
 3      735MB   163GB  162GB

(parted) q                                                                
pjones8:~#