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

Add -W flag to lvcreate from TUI #225

Open
mastergregor opened this issue Dec 9, 2018 · 8 comments
Open

Add -W flag to lvcreate from TUI #225

mastergregor opened this issue Dec 9, 2018 · 8 comments

Comments

@mastergregor
Copy link

mastergregor commented Dec 9, 2018

While re-organizing space on an ESOS box, I ran into an issue where lvcreate hang indefinitely. I have invoked a LV creation from TUI, and used a separate shell to dig a little bit.
Upon closer inspection, since I was re-using space of a previous GPT formated space, I think I ran into an issue that is described briefly here:

saltstack/salt#41798

It looks like lvcreate is invoked from TUI with --name, --size and --type options. In cases where space already has a recognizable partition table or file system, lvcreate will hang on user input.

Now, from a separate shell, I killed the lvcreate process, and created the LV manually from the command line, this time with the -W flag.

I was trying this on ESOS version 1.3.9, and the version of lvcreate that is included has a -W option to proceed with the creation in these circumstances.

It might be worth while to consider adding -W flag to the lvcreate when invoked from TUI. I am not sure if there are any consequences to including this flag though.

@msmith626
Copy link
Contributor

msmith626 commented Dec 10, 2018 via email

@mastergregor
Copy link
Author

mastergregor commented Dec 10, 2018

Sure, I can explain how I got to the situation where I think I needed it.

I created 2 LVs and set them up as targets to two separate FC links. I use straight card-to-card connections, no switched fabric for now. Both of these LVs were set up with vdisk_blockio, and set up on Windows as ReFS drives with a single partition each. LVs were 2TB (lets call this one LV1) and 6TB (lets call this one LV2). Since size is more than 2TB, GPT was used for both drives. Let me try some ASCII graphics to illustrate :)

+----------------+-------------------------+
| --- LV1(2TB)---- |------LV2(6TB)---------- |
+----------------+-------------------------+

This setup worked quite nicely for a few months now, and is used in a small business setting, in production, for shared storage for documentation, DB and media files.

A few weeks ago, I got another 6 drives to populate in the enclosure, and now I had another 13TB of storage to allocate. I have set up another LV with 13TB of storage, let's call that one LV3. This was going to be a bigger storage for media, so it was set up as a windows ReFS drive again, and exported as LUN1 to the same box LV2 was presented to (LV2 was LUN0 of course). Content of LV2 was then moved to LV3, and LV2 was deleted, freeing up the space. So, to illustrate again, storage looked like this:

+----------------+-------------------------+------------------------------------+
| ---- LV1(2TB) ---|------FREE SPACE------- |--------LV3 (13TB)------------------ |
+----------------+-------------------------+------------------------------------+

Now, this free space I decided to dedicate to some linux boxes (web server, DB storage, etc), and I decided to make 2 separate LVs from it, each being 3TB.

When I tried to create the first new LV, from the chunk of now free space, from TUI of the ESOS box, lvcreate got stuck forever. (well, for a good 4 hours before I killed it manually).

What I think happened, as the LVM tried to create LV from the free space, it encountered a GPT (GUID partition table) signature, since it would have been at the beginning sectors of the free space, remaining from previous LV. It then went to prompt for confirmation, but since it was invoked from a subshell (and output redirected to /dev/null :) it never got the answer it wanted, so it waited forever.

I was able to kill it from a separate ssh session, and then manually issue lvcreate, with the same params. This confirmed the problem. I did not complete the LV creation, but instead looked into it a bit, and found a similar problem from salt project. When I put -W on the command line, creation went through without a prompt.

Now, I am not sure if "-W" is appropriate, or if maybe some other behavior would be better here, like zeroing out the partition, or setting it in lvm.conf, or some other mechanism for continuing in these cases. Maybe ask user through TUI if they are sure?

I was just bringing up a scenario where lvcreate might get stuck when invoked from TUI. If you have a test env handy you could try to reproduce the issue and verify that I did not have a glitch of some sort. At this point I am not really willing to mess with a setup that is in daily use :)

@msmith626
Copy link
Contributor

msmith626 commented Dec 10, 2018 via email

@mastergregor
Copy link
Author

mastergregor commented Dec 10, 2018 via email

@msmith626
Copy link
Contributor

msmith626 commented Dec 10, 2018 via email

@mastergregor
Copy link
Author

I got around trying a few things, but I think results are not really what is wanted here:

lvcreatecapture

It looks like "-q -q" makes lvcreate perform as expected, and it completes "successfully" :)

I will keep this setup at it's present state for now, so we can try out different options for lvcreate when there is an existing signature on the volume space.

Ideas?

@mastergregor
Copy link
Author

I did not really make it clear in previous post that "lvcreate -q -q" does create a logical volume, but it does not wipe the existing signature of a previous file system on it.

capture1

I feel this was an important part of information to supply :)

In my case I did not mind that there was an existing FS on it, since I was putting an ext4 partition on it anyhow, but others may want a different behavior in certain situations.

@msmith626
Copy link
Contributor

msmith626 commented Dec 27, 2018 via email

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

No branches or pull requests

2 participants