dappnode / DNP_DAPPMANAGER

Dappnode package responsible for providing the Dappnode Package Manager
GNU General Public License v3.0
31 stars 40 forks source link

Review mountpoint detection feature #905

Open dapplion opened 3 years ago

dapplion commented 3 years ago

To prepare a good strategy for users to update their available disk space, we must review the existing mountpoint feature.

Key entrypoints:

  1. mountpoint detection https://github.com/dappnode/DNP_DAPPMANAGER/blob/master/packages/dappmanager/hostScripts/detect_fs.sh
  2. using bind volumes strategy: a. logic to get bind path https://github.com/dappnode/DNP_DAPPMANAGER/blob/5ca664fa46c16203df3c05c65d2904435823edc3/packages/dappmanager/src/modules/compose/devicePath.ts#L15 b. logic to overwrite compose with bind mount settings https://github.com/dappnode/DNP_DAPPMANAGER/blob/5ca664fa46c16203df3c05c65d2904435823edc3/packages/dappmanager/src/modules/compose/userSettings.ts#L183
3alpha commented 3 years ago

So, I had this idea. We could just run:

const source: str = "Volume1";
const target: str = "/some/path";
await shell(`docker run -v ${source}:/source -v ${target}:/target alpine cp -a /source/. /target`);

After this we could just restart container with the new volume and delete the old one. Also, this command doesn't care whether source or target are named volumes or just paths.

3alpha commented 3 years ago

Issue is tracked in part with #906. Additionally, we can discuss whether to add migration strategy for DAppNodes without LVM.