Sunday, August 28, 2016

Exercise 10-1: Managing Linux Partitions

Complete the following:
1. Power your system on and log in as your student user. 

2. Change to your root user account by entering su – and entering a root password of student. 

3. At the shell prompt, enter fdisk /dev/sdb.
4. View the existing partitions on the device by entering p. 

5. Create a new partition by entering n. 

6. Specify a primary partition by entering p. 

7. Create the first partition on the disk by entering l. 

8. Specify a first cylinder of 1. 

9. Use the default for the last cylinder by pressing enter. 

10. Verify your new partition by entering p. 

11. Write the partition to disk by entering w. 

12. Format the new partition using the ext4 file system by entering mkfs –t ext4 /dev/sdb1. 

13. Wait while the file system is created. 

14. Create a new directory in /mnt named newdisk by entering mkdir /mnt/newdisk. 

15. Mount the new file system in this directory by entering mount –t auto /dev/sdb1 /mnt/ newdisk. 

16. Verify that the disk was mounted by entering mount. 

17. Configure the file system to be automatically mounted every time the system boots by entering vi /etc/fstab at the shell prompt. 

18. Add the following line to the file: 
     /dev/sdb1 /mnt/newdisk ext4 acl,user_xattr 1 2

19. Save your changes and exit vi. 

20. Check your new file system by first unmounting it. Enter umount /mnt/newdisk at the shell prompt. 

21. Enter fsck /dev/sdb1 at the shell prompt. The fsck utility should report that the file system was clean. 

22. Remount the device. 

23. Return to your regular user account by entering exit. 


No comments:

Post a Comment