cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Community Platform Discussions
Connect with fellow community members to discuss general topics related to the Databricks platform, industry trends, and best practices. Share experiences, ask questions, and foster collaboration within the community.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

how to create volume using databricks cli commands

pshuk
New Contributor III

I am new to using volumes on databricks. Is there a way to create volume using CLI commands.

On the similar note, is there a way to create DBFS directories and subdirectories using single command.

for example: I want to copy file here dbfs:/FileStore/Test/Test1/ but neither Test exists nor Test1. 

how can I create both using CLI in the most efficient way?

 

TIA

2 REPLIES 2

Walter_C
Honored Contributor
Honored Contributor

Creates a new volume.

The user could create either an external volume or a managed volume. An external volume will be created in the specified external location, while a managed volume will be located in the default location which is specified bythe parent schema, or the parent catalog, or the Metastore.

For the volume creation to succeed, the user must satisfy following conditions: - The caller must be a metastore admin, or be the owner of th parent catalog and schema, or have the **USE_CATALOG** privilege on the parent catalog and the **USE_SCHEMA** privilege on the parent schema. - The caller must have **CREATE VOLUME** privilege on the parent schema.

 For an external volume, following conditions also need to satisfy - The caller must have **CREATE EXTERNAL VOLUME** privilege on the external location. -There are no other tables, nor volumes existing in the specified storagelocation. - The specified storage location is not under the location of other tables, nor volumes, or catalogs or schemas.

Usage:

 databricks volumes create CATALOG_NAME SCHEMA_NAME NAME VOLUME_TYPE



As for creating DBFS directories and subdirectories, you can use the 
dbfs CLI command. Here's an example of creating the directories Test and Test1:

bash
databricks fs mkdirs dbfs:/FileStore/Test/Test1/

This command creates both the Test and Test1 directories if they do not already exist.

Kaniz_Fatma
Community Manager
Community Manager

Hey there! Thanks a bunch for being part of our awesome community! ๐ŸŽ‰ 

We love having you around and appreciate all your questions. Take a moment to check out the responses โ€“ you'll find some great info. Your input is valuable, so pick the best solution for you. And remember, if you ever need more help , we're here for you! 

Keep being awesome! ๐Ÿ˜Š๐Ÿš€

 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group