Add support for UUID disk and serial number#12
Open
sblanchet wants to merge 1 commit intoamarao:masterfrom
Open
Add support for UUID disk and serial number#12sblanchet wants to merge 1 commit intoamarao:masterfrom
sblanchet wants to merge 1 commit intoamarao:masterfrom
Conversation
6087728 to
6c0dc7b
Compare
Contributor
Author
|
I have just rebased my branch to |
amarao
reviewed
Sep 2, 2024
| disk_device = find_disk( argv[1] ) # by /dev/disk/ | ||
|
|
||
| if disk_device: # a hard disk device has been found | ||
| argv[1] = disk_device # overwrite argv[1] with |
Owner
There was a problem hiding this comment.
Changing argv value is not a good practice. Can we just switch the code below (where argv[1]) is used to use of disk_device?
Basically:
disk_device = find_serial( argv[1] ) # by serial number
if not disk_device:
disk_device = find_disk( argv[1] ) # by /dev/disk/
else:
disk_device = argv[1]
(and replace all uses of argv[1] with disk device).
| for subdir_path in disk_directories: | ||
| files = os.listdir( subdir_path ) | ||
| for f in files: | ||
| if re.search(a_disk_name, f, re.IGNORECASE): # the file match |
Owner
There was a problem hiding this comment.
Do you want to support regexps? How do you plan to use it? sdled s.+z?
May be we can just check for case-insensitive match?
wallentx
suggested changes
Feb 10, 2025
wallentx
left a comment
There was a problem hiding this comment.
I get an error when executing without this
| # print( "Found %s" % absolute_path ) | ||
|
|
||
| # remove trailing digits to get disk device instead of partition device | ||
| absolute_device_path = re.sub("\d+", "", absolute_device_path) |
There was a problem hiding this comment.
Suggested change
| absolute_device_path = re.sub("\d+", "", absolute_device_path) | |
| absolute_device_path = re.sub(r"\d+", "", absolute_device_path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add support for TrueNAS Scale
It means that we can also specify the enclosure slot with
Implementation details:
lsblk --nodeps -o name,serial/dev/disk/by-partuuidto get the partition device/dev/sde2->/dev/sde)