Home > other >  Linux system disk management
Linux system disk management

Time:10-06

Linux system, the disk management

A, planning in the hard disk partition fdisk command
1, how it works: in the interactive operating environment management of disk partitions
2. Format: fdisk [disk devices]
3, commonly used options:
M: see instructions with the help of information
P: list view partition information
N: new partition
D: deleted partitions
T: change the partition type
W: save partition Settings and exit the
Q: give up partition Settings and exit the
Ctrl + backspace key: delete the input error character
4, example:
To host the new a 20 g SCSI hard drives
On the hard disk partition
Divided into two primary partitions, 5 g, the remaining space for extended partition
Set up two logical partitions in the extended partition, the first logical partition 1 g, type of swap, the second logical partition for 9 g,
(1) power off
(2) the new hard drive


(3) boot, check to see if the new hard disk to add

(4) use fdisk partition
/root @ WWW ~ # fdisk/dev/SDB
Device contains neither a valid DOS partition table, nor Sun and SGI/OSF disklabel
Building a new DOS disklabel with disk identifier 0 x4f3a72ac.
Changes will remain in the memory only, until you decide to write them.
After that, of course, the previous content won 't be recoverable.

Warning: invalid flag 0 x0000 of partition table 4 will be corrected by w (rite)

WARNING: DOS - compatible mode is deprecated. It 's strongly It to
Switch off the mode (the command 'c') and change the display units to
Sectors (the command 'u').

For help with a Command (m) : m
The Command action
A toggle a bootable flag
Edit BSD disklabel b
C toggle the DOS compatibility flag
D the delete a partition
L list known partition types
M: print this menu
N the add a new partition
O create a new empty DOS partition table
P: print the partition table
Qq quit without saving changes
S the create a new empty Sun disklabel
T change a partition 's system id
U change the display/entry units
V verify the partition table
W to write the table to disk and exit
X extra functionality (experts only)
For help with a Command (m) : p

Disk/dev/SDB: 21.5 GB, 21474836480 bytes
255 heads, the 63 sectors/track, 2610 cylinders
Units=cylinders of 16065 * 512=8225280 bytes
Sector size (logical/physical) : 512 bytes/512 bytes
I/O size (minimum/optimal) : 512 bytes/512 bytes
Disk identifier: 0 x4f3a72ac

Device Boot Start End Blocks Id System

For help with a Command (m) : n
The Command action
E extended [extended partition]
P primary partition (1-4) [primary partition]
P
Partition number (1-4) : 1
The First cylinder (1-2610, default 1) : enter
Using the default value of 1
The Last cylinder, + cylinders or + size} {K, M, G (1-2610, the default 2610) : + 5 G

For help with a Command (m) : n
The Command action
E extended
P primary partition (1-4)
P
Partition number (1-4) : 2
The First cylinder (655) 655-2610, default: enter
Using the default value of 655
The Last cylinder, + cylinders or + size} {K, M, G (2610) 655-2610, default: + 5 G

For help with a Command (m) : n
The Command action
E extended
P primary partition (1-4)
E
Partition number (1-4) : 4
The First cylinder (1309) 1309-2610, default: enter
Using the default value of 1309
The Last cylinder, + cylinders or + size} {K, M, G (2610) 1309-2610, the default: enter
Using the default value of 2610

For help with a Command (m) : n
The Command action
L logical (5 or over) [logical partition]
P primary partition (1-4)
L
The First cylinder (1309) 1309-2610, default: enter
Using the default value of 1309
The Last cylinder, + cylinders or + size} {K, M, G (2610) 1309-2610, default: + 1 G

For help with a Command (m) : t
Partition number (1-5) : 5
Hex code (type L to list codes) : 82
Changed the system type of partition 5 to 82 (Linux swap/Solaris)

For help with a Command (m) : n
The Command action
L logical (5 or over)
P primary partition (1-4)
L
The First cylinder (1441) 1441-2610, default: enter
Using the default value of 1441
The Last cylinder, + cylinders or + size} {K, M, G (2610) 1441-2610, the default: enter
Using the default value of 2610


For help with a Command (m) : w
The partition table has had altered!

Calling ioctl () to re - read partition table.
Syncing disks.
Two, more than 2 t to the size of the partition planning parted command
1: planning more than 2 t to the size of the partition, also can be used in the planning of small partition
2. Format: parted [option] [partition equipment]
3, the interactive mode of common commands:
?/help/-- help: help
The quit/q: save out
Print print/p:
Mklabel: change the hard disk file type
Mkpart: partition
Rm: to delete a partition, followed by the partition number, for example, the rm 3

4, example:
To host the new a 20 g SCSI hard drives
On the hard disk partition
Change the hard disk type to GPT
Divided into three partitions, 5 g, the first two partitions the rest space is divided to the third partition
(1) power off
(2) the new hard drive


(3) boot, check to see if the new hard disk to add
/root @ WWW ~ # parted -l
Model: VMware and VMware Virtual S (SCSI)
Disk/dev/sda: 107 gb
Sector size (logical/physical) :
512 b/512 bPartition Table: msdos

Number Start End the Size, Type, File system sign
1 1049 KB 525 MB 524 MB primary corruption start
2 525 MB 107 gb 107 gb primary LVM


Model: VMware and VMware Virtual S (SCSI)
Disk/dev/SDB: 21.5 GB
Sector size (logical/physical) :
512 b/512 bPartition Table: msdos

Number Start End the Size, Type, File system sign

/root @ WWW ~ # parted/dev/SDB
The GNU Parted 2.1
nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related