How To Split Partitions In Linux

Table of contents:

How To Split Partitions In Linux
How To Split Partitions In Linux

Video: How To Split Partitions In Linux

Video: How To Split Partitions In Linux
Video: Creating partition in Linux using fdisk 2024, April
Anonim

The Linux operating system uses the fdisk utility to partition a disk. It has nothing to do with the similar utility found in DOS and Windows. This also applies to the commands used to control the program.

How to split partitions in Linux
How to split partitions in Linux

Instructions

Step 1

Make a full backup of all data previously stored on the disk. After repartitioning the partition structure, all information on the disk will be inaccessible. Even if it is to be restored, for this you will have to give the drive to a workshop, whose services are very expensive.

Step 2

Unmount all partitions of the disk to be partitioned. For example, if the sda1 and sda2 partitions are mounted on a USB flash drive named / dev / sda, unmount them with the following sequence of commands: umount / dev / sda1umount / dev / sda2 If unmounting fails, close all applications accessing the disk, then try again.

Step 3

Do not disconnect the device with the eject command, otherwise it will not be available until the computer is restarted or until the next reconnection (if it is removable).

Step 4

Enter the fdisk command with the name of the device to be partitioned, for example: fdisk / dev / sda

Step 5

The fdisk program has a command line interface, however, unlike the program of the same name in DOS and Windows, the commands here are not numeric, but alphabetic. Each of them consists of just one letter. You can find out their full list at any time by entering the m command.

Step 6

Find out what partitions are currently on the disk. To do this, enter the p command.

Step 7

Remove any existing partitions from the disk. To delete each of them, first enter the d command, and then, when prompted, the number of the partition to be deleted.

Step 8

After clearing the disk from the existing partitions, start creating new ones. To do this, use the n command. After entering it, indicate whether the section should be primary or secondary, indicate its starting and ending points in blocks or cylinders, depending on the version of the program.

Step 9

Use the a command to specify which partition should be bootable.

Step 10

In case of an error, exit the program without saving the changes with the q command, and if everything was done correctly, exit the program with the save using the w command. Then format each of the created partitions, except for those intended for swapping. Use the mkfs.ext3 program for this, for example.

Recommended: