Goal
Practise the full life of removable media on server1: find a new disk, mount it, copy files to it, fix a "target is busy" error, and read an ISO file. No real USB stick is needed — you add a small virtual disk.
Before you start
- server1 with RHEL 10 (or CentOS Stream 10 / AlmaLinux 10) and root access.
- Add a new empty virtual disk of 1 GiB to server1 (in virt-manager: Add Hardware → Storage, bus USB if you can choose, else VirtIO). It plays the USB stick.
- An ISO file on server1, for example the RHEL 10 DVD ISO in
/root/. Any ISO works.
Tasks
Tick a task when it is done. Only your browser remembers it.
- Find the name of the new disk. Write down its size and whether the kernel sees it as removable.
- Make one partition on the new disk that uses the whole disk, and format it as
vfatwith the labelLABSTICK. - Mount it on
/mnt/usbso that the userstudentowns all files on it. - As
student, copy/etc/os-releaseto the stick. - Open a second shell,
cd /mnt/usbin it, and try to unmount the stick in the first shell. Find the reason for the error and fix it, then unmount. - Mount the ISO file read-only on
/mnt/isoand list the folders in it. Then unmount it.
Check your work
lsblk -fshows the partition withFSTYPE vfatandLABEL LABSTICK.- While mounted,
ls -lshowsstudentas the owner ofos-release. - After the last task,
findmnt /mnt/usbandfindmnt /mnt/isoprint nothing.
Hints
Show the hints
lsblkbefore and after you add the disk: the new name is the one that appears.parted /dev/sdX mklabel msdos mkpart primary fat32 1MiB 100%makes the partition in one line.vfathas no Linux owners. The mount optionsuid=andgid=set them.lsof /mnt/usborfuser -vm /mnt/usbshows who keeps the folder busy.
Solution
Show the solution
- Compare the disk list. Here the new disk is
/dev/sda(it can be/dev/vdbon VirtIO).lsblk -o NAME,SIZE,RM,TYPE - Partition and format it.
- Mount it for student (UID and GID 1000 on most test systems; check with
id student). - Copy the file as student.
- The second shell is inside the folder. Find it, leave the folder there, then unmount.
- Mount the ISO read-only with a loop device.
My notes
No notes yet.