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

Questions about drive skel and mapping #52

Open
rglastra opened this issue Jun 14, 2021 · 6 comments
Open

Questions about drive skel and mapping #52

rglastra opened this issue Jun 14, 2021 · 6 comments
Labels
enhancement New feature or request

Comments

@rglastra
Copy link

rglastra commented Jun 14, 2021

Hi!

Fantastic script. Just getting it set up, but I'm a little confused on auto_drive.py.
I can see skel files in ~/plot_manager/extras/drive_structures, are these actively sourced by auto_drive.py or does it rely on a file elsewhere to build out the mountpoints?

I've got 4 enclosures of 24 drives each, all front so I'm going to need to edit this to reflect my setup.
Do I just copy one of the skel files and it picks it up accordingly, or is there something I'm missing?

Lastly, after running auto_drive.py without any changes (and unmounting and wiping 2 drives) it only appears to pick up 1. Is this intentional so that one can re-run auto_drive.py as each physical drive comes online, or?

Thanks again for putting this together and releasing it! It'll be a huge help.

@rglastra
Copy link
Author

It looks like ~/plot_manager/extras/drive_structures/drive_structures controls which structure file is applicable, correct?
If so, should I have 1 structure file for all 4 enclosures, or 4 files for each enclosure (and list all 4 in drive_structures accordingly)?

@rglastra
Copy link
Author

Okay, figured it out, at least for 1 enclosure. Still unclear if multiple enclosures require multiple structure files, or if they should all go into a single one. Methinks 1.

To fix my issue with auto_drive.py, I had to simply edit the path_glob in auto_drive.py:

From:

        path_glob = '/mnt/enclosure[0-9]/*/column[0-9]/*

To:

        path_glob = '/mnt/enclosure[0-9]/row[0-9]/*

@rjsears
Copy link
Owner

rjsears commented Jun 14, 2021

You are correct, the way it is written you could have enclosure0, enclosure1, and enclosure2 on the same file structure and it should work fine! My example file structures don't extend that far out but it would be very easy to for you to add multiple structures. The script does expect that structure to be in place already, so make sure to create those mountpoints ahead of time. You could simply update (or add) your own drive structure in the extras/drive_structures folder and rerun the install script and it will create it for you.

@rjsears
Copy link
Owner

rjsears commented Jun 14, 2021

Hi!

Fantastic script. Just getting it set up, but I'm a little confused on auto_drive.py.
I can see skel files in ~/plot_manager/extras/drive_structures, are these actively sourced by auto_drive.py or does it rely on a file elsewhere to build out the mountpoints?

I've got 4 enclosures of 24 drives each, all front so I'm going to need to edit this to reflect my setup.
Do I just copy one of the skel files and it picks it up accordingly, or is there something I'm missing?

Lastly, after running auto_drive.py without any changes (and unmounting and wiping 2 drives) it only appears to pick up 1. Is this intentional so that one can re-run auto_drive.py as each physical drive comes online, or?

Thanks again for putting this together and releasing it! It'll be a huge help.

It should have picked up both drives if you have wiped them. By default, auto_drive.py will only pickup drives that begin with /dev/sd and that DO NOT have any partitions on them. If you run lsblk | grep your_drive and it shows a partition:

sdp
└─sdp1

auto_drive.py will not touch it.

@rglastra
Copy link
Author

rglastra commented Jun 14, 2021

Hi!
Fantastic script. Just getting it set up, but I'm a little confused on auto_drive.py.
I can see skel files in ~/plot_manager/extras/drive_structures, are these actively sourced by auto_drive.py or does it rely on a file elsewhere to build out the mountpoints?
I've got 4 enclosures of 24 drives each, all front so I'm going to need to edit this to reflect my setup.
Do I just copy one of the skel files and it picks it up accordingly, or is there something I'm missing?
Lastly, after running auto_drive.py without any changes (and unmounting and wiping 2 drives) it only appears to pick up 1. Is this intentional so that one can re-run auto_drive.py as each physical drive comes online, or?
Thanks again for putting this together and releasing it! It'll be a huge help.

It should have picked up both drives if you have wiped them. By default, auto_drive.py will only pickup drives that begin with /dev/sd and that DO NOT have any partitions on them. If you run lsblk | grep your_drive and it shows a partition:

sdp
└─sdp1

auto_drive.py will not touch it.

Got it. When I run auto_drive.py once, even though there are multiple drives available it only returns 1 drive. Which is actually fine with me because that way I can initialize each drive sequentially and have it match the physical layout properly.

However, it doesn't appear I can run auto_drive.py in parallel (to speed up the initialization process) as it wants to assign the same mountpoint to both drives.

For example:
Let's say I've got /dev/sda and /dev/sdb, to be assigned to /mnt/enclosure0/column0/drive0 and ../drive1 respectively.
If I run auto_drive.py a second time for /dev/sdb while the initialization for /dev/sda is still occurring (typically xfs format taking its time), it will wants to assign ../drive0 to the second drive. It appears the logic checking for available mountpoints is only updated after a drive is fully initialized (and added to fstab, presumably).

I may look into adding a placeholder 'lockfile' of sorts that includes mountpoints in process of being added, that way you can pop in a drive, run auto_drive, wait a few seconds, pop in another drive, run auto_drive again and have it assign the next available mountpoint accounting for what's already in process of being allocated.

@rjsears
Copy link
Owner

rjsears commented Jun 16, 2021

Yes, this is currently the design of the script, it is designed to be a one shot scripts, you run it once and complete it fully before running it again. It is a very good idea to adjust it in a way that allows you to run it multiple times. Since we have a yaml config file, maybe something as simple as an additional entry with auto_drive in process drives and mountpoints that would skip anything there and move on to the next one, removing the entry (which would no longer be needed) once the process has been completed. Yet another great idea!

@rjsears rjsears added the enhancement New feature or request label Jun 16, 2021
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

2 participants