Subscribe
Accepted Solution

Create parent directories for a junction path using the CLI

Hi,

I'm trying to mount a volume on a deep hierarchy.  For example: /a/long/mount/path/vol1.

If I use vserver setup -vserver vserver1 -storage I can create this long junction path, but I don't want to use the interactive wizard.

Without mounting the root volume from a client, how do I create the parent directories on the vserver root volume?

Cheers,

Greg

Re: Create parent directories for a junction path using the CLI

Create a new 20MB volume and mount it to /namespace.

Then mount all of your volumes under that.

So they would be /namespace/volname.

Re: Create parent directories for a junction path using the CLI

Mount command should create the full path

Sent from my iPhone 5

Re: Create parent directories for a junction path using the CLI

Thanks for the quick response.  Although what you propose will work, I don't want to waste my valuable number of volumes creating mount points.  I'm sure that there is a cleaner way to do this.

Re: Create parent directories for a junction path using the CLI

System manager creates a vol folder under the root vol that could be used.

Otherwise, you're stuck with mounting the vsroot and adding the folder manually.

Re: Create parent directories for a junction path using the CLI

I'm afraid that I already tried this:

cluster1::*> volume mount -vserver vstor-001 -volume vol3 -junction-path /a/long/junction/path

                                                                                                                                                    

Error: command failed: Failed to create or determine if a junction exists within volume 'rootvol1'. Error occurred with the remaining junction

       path of '/a/long/junction/path' for the given path of '/a/long/junction/path'  Reason: Junction create failed (2).

Re: Create parent directories for a junction path using the CLI

Yep, the path has to exist.

Re: Create parent directories for a junction path using the CLI

That can't be the only way.  The vserver setup command will create parent paths as deep as you want:

cstor-001::*> vserver setup -vserver vserver1 -storage

Welcome to the Vserver Setup Wizard, which will lead you through

the steps to create a virtual storage server that serves data to clients.

You can enter the following commands at any time:

"help" or "?" if you want to have a question clarified,

"back" if you want to change your answers to previous questions, and

"exit" if you want to quit the Vserver Setup Wizard. Any changes

you made before typing "exit" will be applied.

You can restart the Vserver Setup Wizard by typing "vserver setup". To accept a default

or omit a question, do not enter a value.

Step 1. Create a Vserver.

You can type "back", "exit", or "help" at any question.

Choose the Vserver data protocols to be configured {nfs, cifs, fcp, iscsi} [nfs]:

Choose the Vserver client services to be configured {ldap, nis, dns}:

Vserver vserver1's allowed protocol list has been modified to nfs

Step 2: Create a data volume

You can type "back", "exit", or "help" at any question.

Do you want to create a data volume? {yes, no} [yes]:

Enter the volume name [vol1]:

Enter the name of the aggregate to contain this volume {aggr1_stor001, aggr1_stor002, aggr1_stor003, aggr1_stor004} [aggr1_stor002]:

Enter the volume size: 2G

Enter the volume junction path [/vol/vol1]: /this/junction/path

It can take up to a minute to create a volume...

Volume vol1 of size 2GB created on aggregate aggr1_stor002 successfully.

Do you want to create an additional data volume? {yes, no} [no]: no

cstor-001::*> volume show -fields junction-path

vserver  volume junction-path

-------- ------ -------------          

vserver1

         vol1   /this/junction/path

I'm pretty sure that the vserver setup wizard doesn't mount the volume and create a directory, so it must be doing something that creates directories on the rootvol.

Re: Create parent directories for a junction path using the CLI

Yep, it creates folders in the root vol.

That seems like a valid workaround for what you'd want to do.

You can re-run vserver setup on the same vserver at any time without worrying about losing stuff.

Re: Create parent directories for a junction path using the CLI

The problem is that it's a workaround.  I don't want this to be interactive.  All I want to know is the magic behind the vserver create wizard that creates directories in the rootvol.