Add a new hard disk of 20 GB capacity on the computer and prepare it to store data by formatting it and make sure the disk is available and online in the Linux system. Create only one primary partition with ext4 file system.
To add and prepare a new 20 GB hard disk in a Linux system for data storage, including formatting, making it available and online, and creating a single primary partition with the ext4 file system, follow these steps:
1. Physically connect the new hard disk to your computer. Ensure it is properly connected and powered on.
2. Open a terminal or console window to access the command line interface.
3. Identify the device name assigned to the new hard disk. Run the following command to list all connected storage devices:
Look for the new device, which typically has a name like /dev/sdX (where X is a letter representing the device).
4.Once you have identified the device name, run the following command to start the partitioning process:
Replace /dev/sdX with the appropriate device name.
5. Inside the fdisk utility, perform the following steps:
- Type n to create a new partition.
- Choose the primary partition type by pressing p.
- Accept the default partition number by pressing 1.
- Accept the default first sector by pressing Enter.
- Specify the last sector by entering +20G. This allocates the entire disk space for the partition.
- Type w to write the changes and exit fdisk.
6. After exiting fdisk, format the newly created partition with the ext4 file system using the following command:
Replace /dev/sdX1 with the appropriate partition identifier.
7. Once the formatting is complete, create a mount point for the new partition. Choose a suitable directory where you want to mount it. For example:
8. Mount the partition to the specified mount point:
9. To ensure that the disk is automatically mounted at system startup, add an entry to the /etc/fstab file. Open the file using a text editor (e.g., nano or vi) and add the following line:
Save and close the file.
10.The hard disk is now available and online in the Linux system with a single primary partition using the ext4 file system. You can start storing data on it by accessing the mount point (/mnt/newdisk in this example).
Remember to replace /dev/sdX and /dev/sdX1 with the appropriate device names identified in step 3 and the corresponding partition number (usually 1).
Comments
Post a Comment