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

DietPi-Drive_Manager | Several #2062

Merged
merged 2 commits into from
Sep 10, 2018
Merged

DietPi-Drive_Manager | Several #2062

merged 2 commits into from
Sep 10, 2018

Conversation

MichaIng
Copy link
Owner

@MichaIng MichaIng commented Sep 9, 2018

Status: ready
🈴 Drives and partitions both are listed as headers (doubled) €: Fixed with Fourdee@daa6ab6

References:

Commit list/description:

  • DietPi-Drive_Manager | Allow sub directories for samba mounts: https://dietpi.com/phpbb/viewtopic.php?f=11&t=4649
  • DietPi-Drive_Manager | When scraping device detection commands, use "continue" instead of "break" to just skip empty lines instead of breaking the whole loop
    • @Fourdee
      Currently, if I am not totally mistaken, an empty line would break the whole output command/file loop. This should never be an issue, since these commands do not have empty lines. But if we already check (failsafe), then continue should do the job, skipping current line and go on with the next.
  • DietPi-Drive_Manager | Keep file permissions when copying fstab
  • DietPi-Drive_Manager | "Destroy()" call is no needed directly before "exit", since it is now called on all kinds of exits via exit trap.
  • DietPi-Drive_Manager | Replace "cat" with "echo" for writing content to file: https://github.com/Fourdee/DietPi/issues/1510#issuecomment-419722975
    • This is something we can roll out to all scripts by times, since the performance difference is huge.
  • DietPi-Drive_Manager | Further minor code and stability improvements
  • DietPi-Drive_Manager | Syntax fix: In "[[ $string == '' ]]", inside single (and double) quotes, braces are taken literally.

+ DietPi-Drive_Manager | Allow sub directories for samba mounts: https://dietpi.com/phpbb/viewtopic.php?f=11&t=4649
+ DietPi-Drive_Manager | When scraping device detection commands, use "continue" instead of "break" to just skip empty lines instead of breaking the whole loop
+ DietPi-Drive_Manager | Keep file permissions when copying fstab
+ DietPi-Drive_Manager | "Destroy()" call is no needed directly before "exit", since it is now called on all kinds of exits via exit trap.
+ DietPi-Drive_Manager | Replace "cat" with "echo" for writing content to file: https://github.com/Fourdee/DietPi/issues/1510#issuecomment-419722975
+ DietPi-Drive_Manager | Further minor code and stability improvements
+ DietPi-Drive_Manager | Syntax fix: In "[[ $string == '<pattern>' ]]", inside single (and double) quotes, braces are taken literally.
@Fourdee
Copy link
Collaborator

Fourdee commented Sep 10, 2018

@MichaIng

Looks good nice one 👍

Currently, if I am not totally mistaken, an empty line would break the whole output command/file loop. This should never be an issue, since these commands do not have empty lines. But if we already check (failsafe), then continue should do the job, skipping current line and go on with the next.

Yep, the break (due to empty line) would stop the loop from processing.

I had to add this in, as, some of the scrapes (i cant remember which), if they had a blank output (no results), the line was still being counted, creating an init of a blank entry.

Break should be fine to use, as if no value, we can assume to stop. Continue would add an extra while read line check, before being terminated (slower, but not by much).
Either way, both are fine I believe.

@Fourdee
Copy link
Collaborator

Fourdee commented Sep 10, 2018

@MichaIng

Great work, merged for testing 👍

@Fourdee Fourdee merged commit 33b8218 into testing Sep 10, 2018
@MichaIng MichaIng deleted the drive_manager branch September 10, 2018 10:19
@MichaIng
Copy link
Owner Author

MichaIng commented Sep 10, 2018

@Fourdee
Ah totally forgot to add discussion about NVMe naming scheme issue, I found:

  • It looks like nvme[0-9]n[0-9] actually defines a drive, not a partition. First number maybe controller or PCIe slot (?), second number drive and certain partition then looks like: nvme[0-9]n[0-9]p[0-9]: https://itpeernetwork.intel.com/finding-your-new-intel-ssd-for-pcie-think-nvme-not-scsi/
  • I guess, same as with /dev/sd[a-z] this can be as well a partition (better say file system), if no partition table is created.
  • In some handling cases, as we search for *p[0-9] this should already work, but we should go through the drive manager and fs resize service code to assure both cases will work.
"...you'll have /dev/nvme0n1 as a block device to format, partition and use."
...
nvme0n1    259:0    0 372.6G  0 disk

└─nvme0n1p1 259:1    0 372.6G  0 part
  • Looks like n[0-9] shall never be removed to get the correct drive source. But would be beneficial to have someone with NVMe drive to test. Does your new x86 system support NVMe?

@Fourdee
Copy link
Collaborator

Fourdee commented Sep 11, 2018

@MichaIng

Does your new x86 system support NVMe?

Yes it does! However, I lack any NVMe drives. £60 for cheapest one I can find, will have to wait.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants