![]() Feel free to comment in case if you have any questions or feedback. Freeing disk space on your Linux server Get to the root of your machine by running cd / Run sudo du -h -max-depth1 Note which directories are using a lot. These steps works on almost all Linux operating systems such as CentOS, RHEL, Oracle Linux, Rocky Linux, Ubuntu etc. I have performed these steps in several servers including production system. If you messed up your master boot record (MBR) you can wipe it using this command : dd if/dev/zero of/dev/hdX bs446 count1 replace X with the target drive. On the /boot partition, check the available space by running the following command: df -h. The steps I mentioned above does not require a reboot. Procedure Log in to the VM as root user or a user with sudo access. Step 4: Unplug or Remove the disk from the server In the Server management console (In case of Dell servers, this console is called iDRaC), select the disk to be removed and delete any virtual disks that are part of this disk. Step 3: Delete the Virtual disk if any from the Server BIOS Method 2: Securely wipe hard disk with shred command. This guide shows you how to use those commands to get a closer look at your disk usage and start freeing up space. Linux Remove All Partitions / Data And Create Empty Disk Method 1: Old good dd command. With this step we have completed all the steps as part of removing a disk from the operating system. Linux provides several built-in commands for analyzing and cleaning up your system’s disk space. The option w stands for write the changes to disk.Īfter the changes are written to the disk, the partitions gets completely deleted from the disk. The option d stands for delete partition option.Īfter entering the input d, the system will delete the partition. An example command is given below fdisk /dev/sdbĪfter executing the fdisk command, it will ask for the option to choose. The disk name can be /dev/sdb or /dev/xvdc etc. The partition can be deleted by using the fdisk command. The command to unmount the disk is given below.Īfter unmounting the disk, remove the entries if any from the /etc/fstab file. Step 1: Remove the entries from fstabįirst unmount the disk from the system and remove the entry corresponding to disk in the /etc/fstab file. ![]() These steps works well on almost all Linux operating systems such as CentOS, RHEL, Ubuntu, Rocky Linux, Oracle Linux etc. In this post, I will explain about the procedure to remove or delete a disk from an existing Linux machine without rebooting or restarting the server. In my previous post, I have explained about the steps to add a new disk to an existing Linux system. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |