Tabla de contenido
Hey guys, today we’re gonna talk about how to increase the file system size on your Linux server.
As you know, the file system is responsible for managing and organizing all the files and directories on your hard drive. On a Linux server, it’s crucial to have a properly configured file system to ensure stability and good performance.
But what happens when you run out of space on your hard drive and need to increase the file system size? Don’t worry, in this article we’ll show you how to increase the file system size on your Linux server in 5 easy steps.
Before starting, it’s important to backup all your data to avoid losses in case of any issues.
Step 1: Identify the Current File System
Before increasing the file system size, it’s crucial to identify which is the current file system on your Linux server. You can use the following command in the terminal:
This command will show you a list of all the mounted file systems on your server, along with their type, size, usage and mount point.
Step 2: Add Space to the Partition
If you need to increase the partition size, you need to do the following:
- Run the command “sudo parted /dev/sdX” (where “/dev/sdX” is the partition you want to increase).
- This will allow you to start the “parted” program with superuser permissions. Use the “print” command to display information about the partitions on the disk.
- Use the “resizepart NUMBER FINAL” command (where “NUMBER” is the number of the partition you want to increase and “FINAL” is the last sector of the partition you want to use) to increase the partition. For example, if the partition you want to increase is “1” and you want to use all the available space on the disk, you should run the following command:
resizepart 1 -1
- Use the “print” command to confirm that the partition has been increased.
- Use the “quit” command to exit the “parted” program.
- Restart your Linux operating system so that the operating system kernel recognizes the new capacity of the partition.
Step 3: Expand the File System
Once you’ve identified the file system you want to increase, it’s time to add space to the partition. There are several ways to do this, depending on the type of file system you have.
If you have an ext2, ext3, or ext4 file system, you’ll need to unmount the mount point. To resize the file system, you can use the resize2fs command:
If you have an XFS file system, you can use the xfs_growfs command:
Step 4: Verify the File System Size
Once you’ve added space to the partition, it’s important to verify that the file system size has increased correctly. You can use the same command as in step 1:
Step 5: Mount the Increased File System
Now that we have the increased file system, it’s necessary to mount it for the changes to take effect. You can use the following command to do so:
Step 6: Verify Available Space
Finally, it’s important to verify that the available space in the increased file system has indeed increased. You can use the following command to check it:
We hope this article was helpful and encourage you to keep exploring and learning with AprendeIT. Until next time!