command: parted
purpose: parted  is  a  disk  partitioning  and  partition resizing program
             for large size hard disks

syntax: parted [options] [device [command [options...]...]]

example:

1. To choose the device to edit

     # parted
       (parted)  select /dev/sda

2. To display all partitions

    # parted
      (parted) print

3. To create primary partition of 20 GB in selected hard disk

    # parted
      (parted) mkpart  primary 100 20000
      where 100 and 20000 is start and end points in mb

4. To create logical partition of 10 GB in selected hard disk

    # parted
      (parted) mkpart logical 20000 30500
      where 20000 and 30500 is start and end points in mb

5. To create a file system on partition

    # parted
      (parted)mkfs

6. To resize partition from one size to other

    # parted
      (parted) resize 3
       start? [20GB]? 20GB
       end? [30GB]? 27GB

      size of partition 3 is actually reduced from 10GB to 7GB.

7. To copy data from partition 2 to 3

    # parted
      (parted) p

     p prints the partition layout
     umount both source and destination partition before copy

     (parted) cp 2 3

8. To remove partition

    # parted
      (parted) rm
      partition number? 3

     the partition with number 3 is deleted

9. To set units in MB, GB, TB respectively

    # parted
      (parted) unit MB
      (parted) unit GB
      (parted) unit TB

10. To create partition and filesystem together

      # parted
        (parted) mkpartfs logical ext4 20000 30500
        logical partition size of 10 GB ext4 fs is created
        20000 and 30500 is start and end points in mb

11. To exit

      # parted
        (parted) q

12. help and info of parted

     # parted
       (parted) help

13. To list all partitions layout

      # parted -l


regards,
dhanasekar
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc
ILUGC Mailing List Guidelines:
http://ilugc.in/mailinglist-guidelines

Reply via email to