Difference between revisions of "Hard drive dock notes"

From LinuxMCE
Jump to: navigation, search
(Move the pic.)
 
Line 1: Line 1:
 
LinuxMCE can almost support hard drive docking. But some pieces need to be engineered to facilitate the process. --[[User:Tschak909|Tschak909]] 02:40, 12 November 2013 (UTC)
 
LinuxMCE can almost support hard drive docking. But some pieces need to be engineered to facilitate the process. --[[User:Tschak909|Tschak909]] 02:40, 12 November 2013 (UTC)
[[Image:Orico_6518SUSB3.jpg|right]]
+
[[Image:Orico_6518SUSB3.jpg|thumb|500px|right|Orico 6518SUS3 Hard Disk Dock]]
 
== Definition of a Hard Disk dock ==
 
== Definition of a Hard Disk dock ==
  

Latest revision as of 04:10, 12 November 2013

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)

Orico 6518SUS3 Hard Disk Dock

Definition of a Hard Disk dock

A Hard Disk dock, is a device, such as the Orico 6518US3, which provides a facility to quickly change out a hard disk to present to a system. To the underlying operating system, this appears as a removable disk (either eSATA or a USB Mass storage device), and with proper care, disks can be swapped for other disks, allowing for an inexpensive way to offload media so that it does not always need to be present. I intend to use this for TV shows, and stuff I won't watch that often. --Tschak909 02:47, 12 November 2013 (UTC)

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.

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.

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.