mb - Make buckets

mb - Make buckets

Synopsis

gsutil mb [-c class] [-l location] [-p proj_id] uri...

Description

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.

Bucket Locations

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)
Example:
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)
Example:
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)
Example:
gsutil mb -c dra -l US-CENTRAL2 gs://some-bucket

Options

-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.

Send feedback about...

Cloud Storage