هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.
الهدف
Use a second disk to create three partitions with a file system, a swap space, and a mount that works after every reboot.
قبل أن تبدأ
- Add an empty 10 GiB disk to server1 (in this lab:
/dev/vdb). Check withlsblkthat it really is empty — use your own device name. - Work as root.
المهام
ضع علامة على المهمة عندما تنتهي منها. متصفحك فقط يتذكر ذلك.
- Create a GPT partition table on the disk with three partitions: 2 GiB, 1 GiB and 2 GiB.
- Put an XFS file system with the label
dataon partition 1, and mount it on/dataat every boot by UUID. - Use partition 2 as extra swap, active at every boot.
- Put an ext4 file system on partition 3. It must be mounted on
/backupat boot with the optionsnoexec,nosuid, with a systemd mount unit (not fstab). - Set the reserved blocks of the ext4 file system to 1 %.
- Reboot and check that everything is mounted and the swap is active.
تحقّق من عملك
lsblk -f /dev/vdb
findmnt /data; findmnt /backup
swapon --show
tune2fs -l /dev/vdb3 | grep -i 'reserved block count'
systemctl is-enabled backup.mount/datais XFS with label data,/backupis ext4 withnoexec,nosuid.- swapon shows
/dev/vdb2next to the system swap. - After the reboot all of it is still there.
تلميحات
اعرض التلميحات
- fdisk:
g, then three timesnwith+2G,+1G,+2G; type of partition 2:swap. blkid /dev/vdb1gives the UUID for fstab.- The unit for /backup is
/etc/systemd/system/backup.mount. tune2fs -m 1.
الحل
اعرض الحل
- Partitions.
- XFS on /data by UUID.
- Swap.
- ext4 with a mount unit./etc/systemd/system/backup.mount
[Unit] Description=Backup disk [Mount] What=/dev/disk/by-uuid/PUT-THE-UUID-HERE Where=/backup Type=ext4 Options=noexec,nosuid [Install] WantedBy=multi-user.target - Reserved blocks.
tune2fs -m 1 /dev/vdb3 - Reboot and check.
ملاحظاتي
لا توجد ملاحظات بعد.