Gnu parted tool




















Parted comes pre-installed in this particular distro, but if you need to install it on a different Linux flavor, there is plenty of information online. For now, let's take a look at the basic operations with which you will want to be familiar. The first thing that you want to do anytime that you need to make changes to your disk is to find out what partitions you already have.

Displaying existing partitions allows you to make informed decisions moving forward and helps you nail down the partition names will need for future commands.

Run the parted command to start parted in interactive mode and list partitions. It will default to your first listed drive. You will then use the print command to display disk information. You can see in the output above that there is no partition table for this partition, so add one by using the mklabel command. Then use mkpart to add the new partition. You are creating a new primary partition using the ext4 architecture. For demonstration purposes, I chose to create a 50 MB partition.

Now that you have created the new partition at 50 MB, you can resize it to MB, and then shrink it back to the original 50 MB. First, note the partition number. You can find this information by using the print command.

You are then going to use the resizepart command to make the modifications. You can then verify the changes with the print command. You can now resize it back down to 50 MB. Keep in mind that shrinking a partition can cause data loss. Again, you will need the partition number, which is found in the print output.

NOTE: Be sure that you have all of the information correct here, there are no safeguards or are you sure? Development of Parted, and GNU in general, is a volunteer effort, and you can contribute. For information, please read How to help GNU. If you'd like to get involved, it's a good idea to join the parted-devel mailing list.

We defend the rights of all software users. There are also other ways to contact the FSF. Documentation Documentation for Parted is available online, as is documentation for most GNU software. Source code Parted uses Git as its source control system. Getting involved Development of Parted, and GNU in general, is a volunteer effort, and you can contribute.

Test releases Trying the latest test release when available is always appreciated. Parted command has to be run as root or a user with Sudo access. Let's check how to print all disk information and its partitions.

By default parted choose first drive. To print all disk partitions type print all. Note: The warning showing in output is because that disk has unallocated disk space yet to be provisioned. To find the unallocated space , choose your disk then run print free command. Later we will discuss how to use resizepart command to extend partition when you have more unallocated disk space. The first step would be to set your required disk label, supported disk label are bsd, loop, gpt, mac, msdos, pc98, and sun.

Instead of using print command, you can run alternative commands such as lsblk , fdisk -l to see partitions created. To grow the partition, it has to be resized first. Resize simple means moving the end position of a partition. To resize each file system to the new capacity, you have to run file system-specific command.



0コメント

  • 1000 / 1000