MountingHDDFilesystems

MountingHDDFilesystems

Status

Introduction

Develop a system to mount hard drive filesystems automatically during installation and in the live CD.

Rationale

The installer and the live CD should both be able to auto-mount filesystems on local hard disks so that users can save files during their LiveCD sessions. When performing advanced/interactive partitioning in the installer, this may be configurable, with sensible defaults; otherwise, filesystems should be mounted in sensible places without the need for user interaction.

Scope and Use Cases

  • A user installs Ubuntu, and wants her music collection to be mounted in a sensible place and accessible from her desktop.
  • A user boots the Ubuntu live CD and wants to save files to a FAT filesystem so that they can be read in Windows.

Implementation Plan

There are two major alternatives for actually mounting the filesystems:

  • pmount (policy mount, used to mount removable media)
    • currently configured to ignore hard disk filesystems, due to security concerns; not keen on relaxing that restriction, and any relaxation has to be considered very carefully
    • allows dynamic rearrangement of filesystems
  • /etc/fstab
    • filesystem mount points would be configured once in the installer, and would not be automatically updated thereafter
    • simple
    • no security concerns

BOF discussion suggested that we should adopt the simpler approach of dumping partitions and mount points into /etc/fstab, and possibly provide a facility to run the autodetection code again from an installed system.

The installer will scan for partitions when starting up partman, and set appropriate mount points as defaults. Automatic installations will use these without user interaction. In the advanced partitioning mode, the user will see the default mount points and be able to adjust or cancel them. As partman shuts down, it will (as usual) write these mount points to /etc/fstab in the system the installer is about to create.

In the live CD, casper just needs to add mount points to /etc/fstab directly before pivoting into the live filesystem. We need to take a certain amount of care with mount options, as the live CD user should be able to write to data filesystems (especially FAT filesystems shared with Windows), but it is desirable for other non-root system processes not to be able to accidentally overwrite these filesystems; furthermore, filesystems should be remounted read-only on errors in order to minimise the possibility of any damage while running the live CD.

Since there are two quite different code paths involved in these two use cases, we will need to create a new common component to avoid code duplication. This component will output partitions and filesystem types in a simple format similar to that produced by os-prober (an installer component which scans disks for installed operating systems).

Mount points will be created under /media by default; this matches pmount, and allows us to take advantage of special cases in gnome-vfs et al. If a filesystem has a label, that will be used as the basename of the default mount point. Failing that, the basename of the device will be used for the mount point, so /dev/hda1 will be mounted on /media/hda1. Again, this matches the behaviour of pmount.

Data Preservation and Migration

Packages Affected

  • hal / gnome-vfs (MartinPitt)

  • partition-prober (new, possibly based on os-prober)
  • partman
  • casper

UbuntuExpress will need to consider setting default mount points based on those selected automatically while booting the live CD.

User Interface Requirements

Part of the installer, so based on cdebconf. The only interaction should be during advanced partitioning.

Outstanding Issues

Check status of LDM (Logical Disk Manager / Windows Dynamic Disks). This shows up on W2K and later Microsoft OSs and is a combination of a partitioning/LVM/RAID0/1/5 support in one. There has been code to read the tables out there since 2001 and code in-kernel to read the disk-labels, but more research needs to be done into the state of the rest of the stack (eg, configuring dm/md/evms to cope with reassembling the partitions).

Shows up as a DOS disk label with a huge type 0x42 primary partition. There is a utter lack of useful documentation including the few crumbs on the Linux NTFS site.

Status: Needinfo.

UDU BOF Agenda

UDU Pre-Work

Implementation Notes

2005-05-09 ColinWatson: partconf-find-partitions may be usable as the component that finds partitions and filesystem types. I've added a --colons option that makes its output easier to parse from shell.

2005-05-31 ColinWatson: mountpoint program added to partconf-mkfstab to get the default mount point. Mount point presetting implemented for the install CD in partman-basicfilesystems.

2005-06-01 ColinWatson: partman-basicfilesystems modified to mount partitions on /media automatically.

Comments

2005-06-01 JanClaeys: once fstab has the right entries, people can use the gnome disk mounting panel applet (or other means) to easily mount partitions, floppies, optical drives, etc. It doesn't require auto-mounting of all NTFS/FAT partitions at boot time (using the option noauto in fstab).

2005-06-01 ColinWatson: Noted. On balance, though, I think I prefer just mounting them automatically, because it's useful and there doesn't seem to be a compelling reason not to do so, especially since it's *less* work to mount them automatically! I think we should only require the additional step from the user if there's a compelling reason.


CategoryUdu CategorySpec

UbuntuDownUnder/BOFs/MountingHDDFilesystems (last edited 2008-08-06 16:27:47 by localhost)