الفلاتر
طريقة البحث
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • "كلمتان" تجد العبارة بالضبط.
  • --name أو -x تجد خيارًا.
  • #كلمة تبحث داخل الأوامر فقط.
  • @grep تجد الدروس والمعامل التي تستخدم grep.
  • الفلاتر: cat:network · in:labs · level:rhcsa · ch:8 · root:yes. ضع ! قبل كلمة لاستبعادها. OR بين الكلمات تعني إحداها.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث

معمل 14.1RH124, الفصل 14

Mount a USB disk and an ISO file, then remove them safely

المستوى
سهل
25 دقيقة
الأجهزة
server1
الحالة
لم يبدأ

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

الهدف

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.

قبل أن تبدأ

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

المهام

  1. Find the name of the new disk. Write down its size and whether the kernel sees it as removable.
  2. Make one partition on the new disk that uses the whole disk, and format it as vfat with the label LABSTICK.
  3. Mount it on /mnt/usb so that the user student owns all files on it.
  4. As student, copy /etc/os-release to the stick.
  5. Open a second shell, cd /mnt/usb in it, and try to unmount the stick in the first shell. Find the reason for the error and fix it, then unmount.
  6. Mount the ISO file read-only on /mnt/iso and list the folders in it. Then unmount it.

تحقّق من عملك

lsblk -f
findmnt /mnt/usb
ls -l /mnt/usb/os-release
findmnt /mnt/iso

تلميحات

اعرض التلميحات

الحل

اعرض الحل
  1. Compare the disk list. Here the new disk is /dev/sda (it can be /dev/vdb on VirtIO).
    lsblk -o NAME,SIZE,RM,TYPE
  2. Partition and format it.
    parted -s /dev/sda mklabel msdos mkpart primary fat32 1MiB 100%
    mkfs.vfat -n LABSTICK /dev/sda1
  3. Mount it for student (UID and GID 1000 on most test systems; check with id student).
    id student
    mkdir -p /mnt/usb
    mount -o uid=1000,gid=1000 /dev/sda1 /mnt/usb
  4. Copy the file as student.
    cp /etc/os-release /mnt/usb/
    ls -l /mnt/usb
  5. The second shell is inside the folder. Find it, leave the folder there, then unmount.
    umount /mnt/usb
    fuser -vm /mnt/usb
    umount /mnt/usb
  6. Mount the ISO read-only with a loop device.
    mkdir -p /mnt/iso
    mount -o loop,ro /root/rhel-10.0-x86_64-dvd.iso /mnt/iso
    ls /mnt/iso
    umount /mnt/iso

ملاحظاتي

لا توجد ملاحظات بعد.

دروس هذا المعمل

الأوامر في هذا المعمل