Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rethink persistence of system drives #12

Open
pschild opened this issue Nov 8, 2018 · 2 comments
Open

Rethink persistence of system drives #12

pschild opened this issue Nov 8, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@pschild
Copy link
Owner

pschild commented Nov 8, 2018

Because there are issues with path.join(<DRIVELETTER>) and in order to make it work on different OSs, system drives should be persisted differently.

Using drivelist package, the information about the system drives can be the following (see https://github.com/balena-io-modules/drivelist):

# MacOS
mountpoints: [
    { "path": "/" },
    { "path": "/private/var/vm" }
]

# GNU/Linux
mountpoints: [
    { "path": "/" },
    { "path": "/boot/efi" }
]

# Windows
mountpoints: [
    { "path": "D:\\" }
]

Possibility A: Make it an own entity / save in own table

Possibility B: Add attribute isSystemDrive: boolean in Folder entity

Related: #10

@pschild pschild added the enhancement New feature or request label Nov 8, 2018
@pschild pschild added this to the first release milestone Nov 8, 2018
@pschild pschild self-assigned this Nov 8, 2018
@pschild
Copy link
Owner Author

pschild commented Nov 8, 2018

Important properties of drivelist output:

isSystem: boolean: should be filtered by true (or do we need to take USB-Drives/SD-Cards into account? Is it also true for an HDD without OS?)
mountpoints: any[]: contains a list of the drive names
device: string/raw: string: contains the drive's name (may be important if mountpoints is an empty array)

@pschild
Copy link
Owner Author

pschild commented Nov 15, 2018

Example output, including only important properties:

Windows (with USB-Drive):

[
  {
    "description": "SM951 NVMe SAMSUNG 512GB",
    "mountpoints": [
      {
        "path": "C:\\"
      }
    ],
    "isSystem": true,
    "isRemovable": false,
    "isCard": false,
    "isSCSI": true,
    "isUSB": false
  },
  {
    "description": "Intenso Ultra Line USB Device",
    "mountpoints": [
      {
        "path": "D:\\"
      }
    ],
    "isSystem": false,
    "isRemovable": true,
    "isCard": false,
    "isSCSI": false,
    "isUSB": true
  }
]

Linux (RPi with USB-Drive):

[
  {
    "description": "INTENSO Intenso Ultra Line",
    "mountpoints": [
      {
        "path": "/media/pi/INTENSO",
        "label": "INTENSO"
      }
    ],
    "isSystem": false,
    "isRemovable": true,
    "isCard": null,
    "isSCSI": false,
    "isUSB": true
  },
  {
    "description": "(boot, rootfs)",
    "mountpoints": [
      {
        "path": "/boot",
        "label": "boot"
      },
      {
        "path": "/",
        "label": "rootfs"
      }
    ],
    "isSystem": false,
    "isRemovable": true,
    "isCard": null,
    "isSCSI": null,
    "isUSB": null
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant