mountAttach a filesystem to the directory tree
mount attaches a filesystem (a disk, a partition, an NFS share, a tmpfs) to a directory so its files appear there. With no arguments it lists what is mounted; /etc/fstab tells the system what to mount at boot.
mount [-t TYPE] [-o OPTIONS] DEVICE DIR | mount -a | mountYou want to see which devices are mounted where and with what options, without wading through dozens of pseudo filesystems.
sudoMounting changes the system-wide tree, so it needs root (unless fstab marks the entry 'user').
mount resolves the source (UUID= and LABEL= through /dev/disk/by-uuid symlinks that udev maintains), detects the type with libblkid if -t is missing, then calls the kernel: the classic mount(2) syscall, or on util-linux 2.39 and newer kernels the fsopen/fsconfig/fsmount/move_mount API. The kernel finds the filesystem driver, reads and validates the superblock, replays the journal if the last shutdown was unclean, and creates a mount object that it attaches to the directory's dentry in your mount namespace. From then on every path lookup that reaches /archive crosses into the new filesystem; the old contents of the directory are hidden, not deleted. The result shows in /proc/self/mountinfo (findmnt reads it). At boot, systemd-fstab-generator turns each /etc/fstab line into a .mount unit; a missing device without nofail drops the machine into emergency mode.
A block device only becomes files and directories once the kernel reads its filesystem and attaches it to a directory in the tree.
When the EBS volume is attached, the NVMe driver registers a block device and udev creates /dev/nvme2n1. It is just numbered blocks; there are no files yet.
(no args) / findmntList current mounts; findmnt shows a readable tree-t TYPEFilesystem type: ext4, xfs, nfs4, tmpfs, vfat, iso9660...-o OPTSComma-separated options: ro, rw, noatime, noexec, nosuid, nodev, nofail...-aMount everything in /etc/fstab that isn't mounted yet (and not noauto)-o remount,OPTSChange options of a mounted filesystem in place, e.g. remount,rw--bind OLD NEWMake a directory tree visible at a second place-o loopMount a filesystem image file through a loop device-r / -wRead-only / read-write (same as -o ro / -o rw)-vVerbose: say what was mounted wherefindmnt --verifyCheck /etc/fstab for errors before you reboot/dev/nvme1n1 /data ext4 defaults 0 2 in /etc/fstabNVMe device names follow discovery order and can change after a reboot or a new attachment, so the wrong disk may be mounted on /data.
UUID=5d1e7f3a-... /data ext4 defaults,nofail 0 2Adding an fstab line and rebooting to test itA typo or a missing device without nofail can drop the instance into emergency mode, and on EC2 you have no console keyboard by default.
sudo findmnt --verify && sudo mount -aCopying files into /data while the volume isn't mountedThey land on the root filesystem and become hidden (but still use space) once the volume is mounted on top.
findmnt /data (or mountpoint /data) before writingecho '...' >> /etc/fstab with sudo in frontThe redirect is done by your unprivileged shell, so you get 'Permission denied'.
echo '...' | sudo tee -a /etc/fstabTry these on a Linux machine of your own. Each task has a hint and a solution.
List all mounted filesystems as a tree, then show only the mount holding /var/log. On a server you'd add -t ext4 to see only ext4 filesystems (the practice sandbox's root is an overlay, so that prints nothing there).
Check /etc/fstab for errors without mounting or rebooting.
Make ~/app visible read-only at /srv/app with a bind mount, and prove it's read-only. (May be refused in the sandbox; then write the commands.)
Write an fstab line that mounts the filesystem with label 'archive' on /archive, without updating access times, and without blocking boot if the disk is missing.
mountAttach a filesystem to the directory tree
mount attaches a filesystem (a disk, a partition, an NFS share, a tmpfs) to a directory so its files appear there. With no arguments it lists what is mounted; /etc/fstab tells the system what to mount at boot.
mount [-t TYPE] [-o OPTIONS] DEVICE DIR | mount -a | mountYou want to see which devices are mounted where and with what options, without wading through dozens of pseudo filesystems.
sudoMounting changes the system-wide tree, so it needs root (unless fstab marks the entry 'user').
mount resolves the source (UUID= and LABEL= through /dev/disk/by-uuid symlinks that udev maintains), detects the type with libblkid if -t is missing, then calls the kernel: the classic mount(2) syscall, or on util-linux 2.39 and newer kernels the fsopen/fsconfig/fsmount/move_mount API. The kernel finds the filesystem driver, reads and validates the superblock, replays the journal if the last shutdown was unclean, and creates a mount object that it attaches to the directory's dentry in your mount namespace. From then on every path lookup that reaches /archive crosses into the new filesystem; the old contents of the directory are hidden, not deleted. The result shows in /proc/self/mountinfo (findmnt reads it). At boot, systemd-fstab-generator turns each /etc/fstab line into a .mount unit; a missing device without nofail drops the machine into emergency mode.
A block device only becomes files and directories once the kernel reads its filesystem and attaches it to a directory in the tree.
When the EBS volume is attached, the NVMe driver registers a block device and udev creates /dev/nvme2n1. It is just numbered blocks; there are no files yet.
(no args) / findmntList current mounts; findmnt shows a readable tree-t TYPEFilesystem type: ext4, xfs, nfs4, tmpfs, vfat, iso9660...-o OPTSComma-separated options: ro, rw, noatime, noexec, nosuid, nodev, nofail...-aMount everything in /etc/fstab that isn't mounted yet (and not noauto)-o remount,OPTSChange options of a mounted filesystem in place, e.g. remount,rw--bind OLD NEWMake a directory tree visible at a second place-o loopMount a filesystem image file through a loop device-r / -wRead-only / read-write (same as -o ro / -o rw)-vVerbose: say what was mounted wherefindmnt --verifyCheck /etc/fstab for errors before you reboot/dev/nvme1n1 /data ext4 defaults 0 2 in /etc/fstabNVMe device names follow discovery order and can change after a reboot or a new attachment, so the wrong disk may be mounted on /data.
UUID=5d1e7f3a-... /data ext4 defaults,nofail 0 2Adding an fstab line and rebooting to test itA typo or a missing device without nofail can drop the instance into emergency mode, and on EC2 you have no console keyboard by default.
sudo findmnt --verify && sudo mount -aCopying files into /data while the volume isn't mountedThey land on the root filesystem and become hidden (but still use space) once the volume is mounted on top.
findmnt /data (or mountpoint /data) before writingecho '...' >> /etc/fstab with sudo in frontThe redirect is done by your unprivileged shell, so you get 'Permission denied'.
echo '...' | sudo tee -a /etc/fstabTry these on a Linux machine of your own. Each task has a hint and a solution.
List all mounted filesystems as a tree, then show only the mount holding /var/log. On a server you'd add -t ext4 to see only ext4 filesystems (the practice sandbox's root is an overlay, so that prints nothing there).
Check /etc/fstab for errors without mounting or rebooting.
Make ~/app visible read-only at /srv/app with a bind mount, and prove it's read-only. (May be refused in the sandbox; then write the commands.)
Write an fstab line that mounts the filesystem with label 'archive' on /archive, without updating access times, and without blocking boot if the disk is missing.