Mount point

2 snippets across 2 stacks - Bash & Linux, Docker

Also written as mount points

SHBash & Linux

List Block Devices

SH · System Info
Syntax
lsblk [options]
Example
lsblk -f
Output
NAME   FSTYPE  LABEL   SIZE MOUNTPOINT
sda                    100G
├─sda1 ext4   root     50G /
├─sda2 swap            4G  [SWAP]
└─sda3 xfs    data    46G  /data

Note -f shows filesystem type, label, UUID, and mount points. Useful for identifying disks before mounting or partitioning. Linux only; on macOS, use diskutil list.

DKDocker

VOLUME - Declare Mount Point

DK · Dockerfile
Syntax
VOLUME ["/path/to/dir"]
Example
VOLUME ["/var/lib/postgresql/data"]

Note Creates an anonymous volume at that path when no explicit mount is provided. This prevents data from growing the container's writable layer. However, anonymous volumes are hard to manage - prefer named volumes via docker run -v.

Frequently asked questions

How do you mount point?
This task is covered in 2 stacks on this page: Bash & Linux, Docker. The "List Block Devices" snippet in Bash & Linux uses `lsblk [options]`.
Which command does the Bash & Linux example use?
The "List Block Devices" snippet uses `lsblk [options]`, from the System Info section of the Bash & Linux cheat sheet.
Which stacks cover "mount point" on this page?
Bash & Linux, Docker. Together they hold 2 copy-ready snippets for this task.
Is there anything to watch out for?
Yes. For "List Block Devices": -f shows filesystem type, label, UUID, and mount points. Useful for identifying disks before mounting or partitioning. Linux only; on macOS, use diskutil list.