mb - Make buckets
gsutil mb [-c class] [-l location] [-p proj_id] uri...
The mb command creates a new bucket. Google Cloud Storage has a single namespace, so you will not be allowed to create a bucket with a name already in use by another user. You can, however, carve out parts of the bucket name space corresponding to your company’s domain name (see “gsutil help naming”).
If you don’t specify a project ID using the -p option, the bucket will be created using the default project ID specified in your gsutil configuration file (see gsutil help config). For more details about projects see gsutil help projects.
The -c and -l options specify the storage class and location, respectively, for the bucket. Once a bucket is created in a given location and with a given storage class, it cannot be moved to a different location, and the storage class cannot be changed. Instead, you would need to create a new bucket and move the data over and then delete the original bucket.
Bucket Storage Classes
If you don’t specify a -c option, the bucket will be created with the default (Standard) storage class.
If you specify -c DURABLE_REDUCED_AVAILABILITY (or -c DRA), it causes the data stored in the bucket to use Durable Reduced Availability storage. Buckets created with this storage class have lower availability than Standard storage class buckets, but durability equal to that of buckets created with Standard storage class. This option allows users to reduce costs for data for which lower availability is acceptable. Durable Reduced Availability storage would not be appropriate for “hot” objects (i.e., objects being accessed frequently) or for interactive workloads; however, it might be appropriate for other types of applications. See the online documentation for pricing and SLA details.
If you specify -c NEARLINE (or -c NL), it causes the data stored in the bucket to use Nearline storage. Buckets created with this storage class have higher latency and lower throughput than Standard storage class buckets. The availability and durability remains equal to that of buckets created with the Standard storage class. This option is best for objects which are accessed rarely and for which slower performance is acceptable. See the online documentation for pricing and SLA details.
If you don’t specify a -l option, the bucket will be created in the default location (US). Otherwise, you can specify one of the available multi-regional locations.
- ASIA (Asia Pacific)
- EU (European Union)
- US (United States)
- gsutil mb -l ASIA gs://some-bucket
You can also create a bucket in a regional location. The following regional locations support all storage classes:
- ASIA-EAST1 (Eastern Asia-Pacific)
- EUROPE-WEST1 (Western Europe)
- US-CENTRAL1 (Central United States)
- US-EAST1 (Eastern United States)
- gsutil mb -c NEARLINE -l EUROPE-WEST1 gs://some-bucket
The following regional locations are in Alpha and support just the Durable Reduced Availability storage class (-C DRA). Data stored in these locations is not subject to the usual SLA. See the bucket location documentation for additional information.
- US-CENTRAL2 (Central United States)
- US-EAST2 (Eastern United States)
- US-EAST3 (Eastern United States)
- US-WEST1 (Western United States)
- gsutil mb -c DRA -l US-CENTRAL2 gs://some-bucket
|-c class||Can be DRA (or DURABLE_REDUCED_AVAILABILITY), NL (or NEARLINE), or S (or STANDARD). Default is STANDARD.|
|-l location||Can be any multi-regional or regional location as described above. Default is US. Locations are case insensitive.|
|-p proj_id||Specifies the project ID under which to create the bucket.|