Hard drive dock notes
From LinuxMCE
LinuxMCE can almost support hard drive docking. But some pieces need to be engineered to facilitate the process. --Tschak909 02:40, 12 November 2013 (UTC)
Contents
UI Components
- Manage Hard Drive screen
- Attach Eject to hard drive button, make hidden if not removable disk.
- Disk is Ready for use, alert.
- Format Disk screen, with disk name, and "Windows or LinuxMCE" button.
Database Components
- Add Is Removable device data, so that we can do additional UI behavior
Script components
Eject_Removable_DIsk.sh
- Add Eject_Removable_Disk.sh which given a device #, and an Orbiter Device #, will do the following:
- Stop UpdateMedia
- Throw a lock "HardDriveEjected"
- all StorageDevices_* scripts will WaitLock this, so that they are suspended while disk ejection happens.
- exportfs -u the affected NFS share, on ALL media directors (TODO: Find out how best to do this, can StorageDevices_Setup.sh be used to this end?)
- Unmount disk immediately.
- Indicate that the Disk is safe to be removed by CMD_Display_Alert to orbiter PK_Device specified in second parameter.
- Loop Wait for USB device to disappear from system, courtesy of UDEV (we keep the UUID, so we can track when this disk actually falls away. Loop.
- When disk falls away, relinquish the lock.
- Run StorageDevices_Setup.sh
- Restart UpdateMedia
Format_Removable_Disk.sh
- Given a raw device path, and a filesystem name (ext3, ext4, xfs, jfs):
- If disk is blank, Create a single partitionformat it with the given filesystem.
- If the requested filesystem is NTFS, or FAT32, use the appropriate Microsoft compatible partition
- Otherwise, use Linux partition.
- If disk is not blank, politely exit with a non zero error code.
- If disk is blank, Create a single partitionformat it with the given filesystem.
StorageDevices_Setup.sh
- While traversing disks to setup, find related interface parent given UUID.
- If UUID belongs to a USB or eSATA channel, immediately assume that this disk is removable. Set Is Removable device data to true for this device.
- If disk is indeed removable, and it now shows up, look at PK_Users device data, and run UpdateMedia for the affected paths immediately.
- If UUID belongs to a USB or eSATA channel, immediately assume that this disk is removable. Set Is Removable device data to true for this device.
User Facing Behavior
This is preliminary, and subject to refinement, but I believe this will provide the following user facing behavior:
If this disk is Blank
- Show format screen.
- User formats disk
- User is then presented with the usual "Found a disk" screen.
If disk is already in device tree
- Simple notice will be shown top left, that disk is being added.
- Once UpdateMedia is done, then alert will be shown indicating to user that disk is ready to be used.
If Disk hasn't been placed in device tree
- Orbiter will ask whether user wants to use disk using usual methods.