Block volumes on PCA 3.x: create, attach and mount a data disk
Add storage to a Private Cloud Appliance 3.x instance: create a block volume, attach it as paravirtualized, then format and mount it in Linux by its stable SCSI ID with _netdev,nofail.
Block volumes are network disks that live on the appliance’s ZFS Storage Appliance and attach to compute instances. This guide covers Private Cloud Appliance 3.x and follows the PCA User Guide.
1. Create the volume
In the Compute Web UI the size range is 50 GB to 32768 GB (32 TB). With the CLI, the minimum is an availability domain and a compartment; usually you also set a name and size.
oci bv volume create \
--availability-domain AD-1 \
--compartment-id ocid1.compartment.unique_ID \
--display-name data01 \
--size-in-gbs 100 \
--vpus-per-gb 10
PCA-specific settings documented by Oracle:
--vpus-per-gb: 10 (default, balanced) or 20 (high performance). It cannot be changed after creation.PCA_blocksizefree-form tag: block size as a power of two from 512 bytes to 1 MB, default 8192. It cannot be changed after creation.OraclePCAdefined tagslogBias(LATENCYdefault, orTHROUGHPUT) andsecondaryCache(ALLdefault,METADATAorNONE).
Wait until the volume is AVAILABLE:
oci bv volume list --compartment-id ocid1.compartment.unique_ID --output table
2. Attach it to an instance
On PCA the attachment type for the CLI is paravirtualized, and --type is required.
oci compute volume-attachment attach \
--instance-id ocid1.instance.unique_ID \
--volume-id ocid1.volume.unique_ID \
--type paravirtualized
The Web UI offers three access modes: Read/Write (default, one instance), Read/Write – Shareable, and Read Only – Shareable. With the CLI, add --is-shareable true for a shared attachment. Once a volume is attached read-only, it can only be attached to other instances read-only. Only share a read/write volume between instances if the file system or application is built for shared access (a cluster file system); ordinary ext4 or XFS will be corrupted by two writers.
3. Find the disk inside the guest
Log in to the instance. Do not rely on names like /dev/sdb: the docs warn they are not guaranteed to stay the same across reboots when there is more than one non-root volume. Use the stable ID instead.
Check before you run this
- Runs with administrator rights. Make sure you understand every line.
sudo ls -l /dev/disk/by-id/
# example line:
# scsi-3600144f096933b92000061b1129e0037 -> ../../sdb
4. Create a file system and mount it
Warning: mkfs erases everything on the target device. Double-check that the by-id path points to the new, empty volume (compare its size with lsblk) before running it.
Check before you run this
- Formats or repartitions a disk and erases its data.
- Runs with administrator rights. Make sure you understand every line.
lsblk
sudo mkfs.ext4 /dev/disk/by-id/scsi-3600144f096933b92000061b1129e0037
sudo mkdir -p /mnt/data01
Add the volume to /etc/fstab using the SCSI ID. Oracle’s example uses _netdev (treat it as a network device) and nofail (boot continues if the volume is missing, which also matters when you create custom images from the instance):
/dev/disk/by-id/scsi-3600144f096933b92000061b1129e0037 /mnt/data01 ext4 _netdev,nofail 0 0
Check before you run this
- Runs with administrator rights. Make sure you understand every line.
sudo mount -a
mount | grep /mnt/data01
df -h /mnt/data01
Detaching later
Unmount the file system in the guest and remove or comment out its /etc/fstab line before you detach the volume in the Compute Web UI or CLI. Detaching a mounted disk can lose data that has not been written yet.
Official documentation
See also
- 0116 PCA 3.x Compute Enclave concepts: tenancies, compartments, VCNs, instances, images and shapes The PCA 3.x Compute Enclave uses OCI building blocks: a tenancy holds compartments, which hold networks, instances and storage. Instances are built… Beginner · Concept · Linux Article Architecture & concepts · Compute, networking & storage 15 Oct 2026
- 0117 Configure the OCI CLI for Oracle Private Cloud Appliance 3.x Point the standard OCI CLI at a PCA 3.x Compute Enclave: create an API key, write ~/.oci/config with the appliance as the… Intermediate · How-to · Any system Article Compute, networking & storage 15 Oct 2026
- 0118 Create a compute instance on PCA 3.x with the Compute Web UI or OCI CLI Launch a VM in the Private Cloud Appliance 3.x Compute Enclave: gather an image, shape, subnet and SSH key, then create the… Intermediate · How-to · Any system Article Compute, networking & storage 15 Oct 2026
- 0119 PCA 3.x networking basics: create a VCN, subnets and security lists On Private Cloud Appliance 3.x, instances need a VCN and a subnet. Create them in the Compute Web UI or OCI CLI… Intermediate · How-to · Any system Article Compute, networking & storage 15 Oct 2026
Repos in the wild
- OCI CLI: Oracle Cloud Infrastructure command-line interface oracle/oci-cli Oracle's open-source command-line tool for Oracle Cloud Infrastructure. Private Cloud Appliance 3.x uses the same CLI for its OCI-compatible Compute Enclave. GitHub
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- commitpedia-admin +3,212 chars