LibAtaForAtaDisks

Differences between revisions 3 and 4
Revision 3 as of 2006-05-01 20:43:44
Size: 1739
Editor: karlsson
Comment:
Revision 4 as of 2006-06-22 16:25:27
Size: 3730
Editor: ALagny-109-1-2-101
Comment: spam spac
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
 * '''Contributors''': AndersKarlsson
 * '''Packages affected''': kernel, udev

DRAFT - BRAINDUMP - NOT COMPLETE - WORK IN PROGRESS - I am still thinking about pro/con situations.
 * '''Contributors''': BenCollins, ScottJamesRemnant, ColinWatson, AdamConrad, JeffBailey, AndersKarlsson
 * '''Packages affected''': linux-source-2.6.17, udev, partman-target, base-files, grub, lilo, yaboot, silo, palo, elilo
Line 12: Line 10:
There is work on the go by Alan Cox in the kernel to make libata handle PATA disks as well as SATA disks. This would allow for a simpler install image due to all disks becoming sdXY. Alan has a web-place, http://zeniv.linux.org.uk/~alan/IDE/ , where there is a file, STATUS.txt, detailing progress. I will have a look through the files there and then update this page again. Replace the existing PATA storage drivers in the IDE subsystem with libata-pata drivers which expose the devices through the SCSI subsystem, and migrate users to using mounting by UUID to allow for changes in either direction.
Line 16: Line 14:
One interface for all things ATA, allow drivers/ide to go away. One namespace for disks whether SCSI or ATA.

== Use cases ==

== Scope ==
The success of libata for SATA support has resulted in Alan Cox working to port the existing IDE subsystem drivers to libata as well. This will eventually result in us having to only cope with one "storage" subsystem and make our lives somewhat simpler. In a gesture of being good community members, we can offer Alan wide-spread testing for his code by deploying it in our development release and make a positive contribution to the community.
Line 24: Line 18:
Alan Cox's patches are available from http://zeniv.linux.org.uk/~alan/IDE/ and will be applied to our kernel; we will disable any of the drivers that appear to be completely missing or unsupported and leave enabled those that are well-tested or for which we can give mass testing.

In particular, `ide-generic` can be disabled in favour of the libata-pata legacy support.

If significant problems occur before release, the drivers can be disabled and the existing IDE subsystem ones used.
Line 26: Line 26:
ScottJamesRemnant notes:
 * Requires migrating all references to disks; including boot-loader, /etc/fstab and just about anywhere else they might show up.
 * I'd recommend migrating them to UUID-based paths, rather than /dev/sd*; e.g. UUID=xxx or /dev/disk/by-uuid/xxx for each case.
 * This can be done *before* upgrading (/dev/hd* have uuids too) so that after reboot, everything still works even though they're now on the scsi subsystem
 * And this gives them free removable/swappable disk support (take your root disk out, put it in usb cradle, boot another machine with it and it just works)
=== udev ===
Line 32: Line 28:
=== Code === The scripts run by `udev` in the initramfs are largely driver-independant, and will automatically load the correct driver after the migration. The only change will be the name of the legacy driver we load.
Line 34: Line 30:
=== Data preservation and migration === === Installer ===
Line 36: Line 32:
== Outstanding issues == When installing new systems, `partman-target` will write the UUID of the partitions to `/etc/fstab` with a comment above giving the name of the device as the installer saw it. The generated fstab would then look something like:
Line 38: Line 34:
 {{{
proc /proc proc defaults 0 0
# /dev/hda1
UUID=0080a51f-df64-4932-8ce4-ee1d9b520708 / ext3 defaults,errors=remount-ro 0 1
/dev/hda5 none swap sw 0 0
}}}
Line 39: Line 41:
== BoF agenda and discussion == === Existing install migration ===

When a user updates their system, the `postinst` of `base-files` will rewrite the `/etc/fstab` file to match that which the installer would have written. The first version of the kernel to ship with the patch applied will depend on this version of `base-files` to ensure that the migration has happened.

This will work because the migration is performed on the old kernel while the disk information is still available in the right form, the UUID can be obtained using `vol_id` on the `/dev/hdXY` device.

=== Boot-loader migration ===

Boot loaders need to update their configurations so that they pass `root=UUID=$UUID` to the kernel for the root filesystem, which `initramfs-tools` supports. They may also need to update the install device if they require such things, as noted below:

 * `grub` infers the install device.

 * `yaboot` uses a system path to the device, and does not need modification.

 * others require modification to use the appropriate `/dev/disk/by-uuid/$UUID` symlink.

To ensure this is performed before the kernel is upgraded, and to correct the problem of being able to have a kernel without a bootloader, all bootloaders will provide a `linux-boot-loader` virtual package. The kernel will depend on this, and conflicts (or breaks, when implement) versions older than necessary boundaries.

Summary

Replace the existing PATA storage drivers in the IDE subsystem with libata-pata drivers which expose the devices through the SCSI subsystem, and migrate users to using mounting by UUID to allow for changes in either direction.

Rationale

The success of libata for SATA support has resulted in Alan Cox working to port the existing IDE subsystem drivers to libata as well. This will eventually result in us having to only cope with one "storage" subsystem and make our lives somewhat simpler. In a gesture of being good community members, we can offer Alan wide-spread testing for his code by deploying it in our development release and make a positive contribution to the community.

Design

Alan Cox's patches are available from http://zeniv.linux.org.uk/~alan/IDE/ and will be applied to our kernel; we will disable any of the drivers that appear to be completely missing or unsupported and leave enabled those that are well-tested or for which we can give mass testing.

In particular, ide-generic can be disabled in favour of the libata-pata legacy support.

If significant problems occur before release, the drivers can be disabled and the existing IDE subsystem ones used.

Implementation

udev

The scripts run by udev in the initramfs are largely driver-independant, and will automatically load the correct driver after the migration. The only change will be the name of the legacy driver we load.

Installer

When installing new systems, partman-target will write the UUID of the partitions to /etc/fstab with a comment above giving the name of the device as the installer saw it. The generated fstab would then look something like:

  • proc /proc proc defaults 0 0
    # /dev/hda1
    UUID=0080a51f-df64-4932-8ce4-ee1d9b520708 / ext3 defaults,errors=remount-ro 0 1
    /dev/hda5 none swap sw 0 0

Existing install migration

When a user updates their system, the postinst of base-files will rewrite the /etc/fstab file to match that which the installer would have written. The first version of the kernel to ship with the patch applied will depend on this version of base-files to ensure that the migration has happened.

This will work because the migration is performed on the old kernel while the disk information is still available in the right form, the UUID can be obtained using vol_id on the /dev/hdXY device.

Boot-loader migration

Boot loaders need to update their configurations so that they pass root=UUID=$UUID to the kernel for the root filesystem, which initramfs-tools supports. They may also need to update the install device if they require such things, as noted below:

  • grub infers the install device.

  • yaboot uses a system path to the device, and does not need modification.

  • others require modification to use the appropriate /dev/disk/by-uuid/$UUID symlink.

To ensure this is performed before the kernel is upgraded, and to correct the problem of being able to have a kernel without a bootloader, all bootloaders will provide a linux-boot-loader virtual package. The kernel will depend on this, and conflicts (or breaks, when implement) versions older than necessary boundaries.


CategorySpec

LibAtaForAtaDisks (last edited 2008-08-06 16:23:11 by localhost)