fdisk
Use fdisk to partition a storage medium.
Syntax
fdisk medium-name [ partition-number ]
Views
User view
Predefined user roles
network-admin
mdc-admin
Parameters
medium-name: Specifies the name of the storage medium to be partitioned.
partition-number: Specifies the number of partitions, in the range of 1 to 4.
Usage guidelines
The Flash cannot be partitioned.
If the partition-number argument is specified, the storage medium is divided into the specified number of partitions. Otherwise, partitioning is performed in an interactive way.
It is normal that the specified partition size and the actual partition size have an error less than 5% of the total memory.
A partition cannot be partitioned.
Before partitioning a USB disk:
Back up the files in the storage medium. The partition operation clears all data in the medium.
If you are partitioning a USB disk, make sure the disk is not write protected. Otherwise, the partition operation will fail, and you must remount or reinstall the disk to restore access to the USB disk.
Make sure no other users are accessing the medium. Otherwise, the partition operation fails.
Examples
# Divide the USB disk on the device evenly into three partitions in simple mode.
<Sysname> fdisk usb: 3 Capacity of usb: : 256M bytes usb: will be divided into the following partitions: DeviceName Capacity usb0: 85MB usb1: 85MB usb2: 86MB All data on usb: will be lost, continue? [Y/N]:y Partitioning usb:...Done.
# Divide the USB disk on the device into one partition in an interactive way.
<Sysname> fdisk usb: The capacity of usb: : 256M bytes Partition 1 (32MB~224MB, 256MB. Press CTRL+C to quit or Enter to use all available space):
// Press Enter or enter 256.
usb: will be divided into the following partition(s): DeviceName Capacity usb0: 256MB All data on usb: will be lost, continue? [Y/N]:y Partitioning usb:...Done.
# Divide the USB disk on the device into three partitions and specify the size for each partition:
<Sysname> fdisk usb: The capacity of usb: : 256M bytes Partition 1 (32MB~224MB, 256MB, Press CTRL+C to quit or Enter to use all available space):128
// Enter 128 to set the size of the first partition to 128 MB.
Partition 2 (32MB~96MB, 128MB, Press CTRL+C to quit or Enter to use all available space):31
// Enter 31 to set the size of the second partition to 31 MB.
The partition size must be greater than or equal to 32MB. Partition 2 (32MB~96MB, 128MB, Press CTRL+C to quit or Enter to use all available space):1000
// Enter 1000 to set the size of the second partition to 1000 MB.
The partition size must be less than or equal to 128MB. Partition 2 (32MB~96MB, 128MB, Press CTRL+C to quit or Enter to use all available space):127
// Enter 127 to set the size of the second partition to 127 MB.
The remaining space is less than 32MB. Please enter the size of partition 2 again. Partition 2 (32MB~96MB, 128MB, Press CTRL+C to quit or Enter to use all available space):
// Enter 56 to set the size of the second partition to 56 MB.
Partition 3 (32MB~40MB, 72MB, Press CTRL+C to quit or Enter to use all available space):
// Press Enter to assign the remaining space to the third partition.
usb: will be divided into the following partition(s): DeviceName Capacity usb0: 128MB usb1: 56MB usb2: 72MB All data on usb: will be lost, continue? [Y/N]:y Partitioning usb:...Done.