linux 查看磁盘分区

fdisk

NAME
fdisk - manipulate disk partition table

SYNOPSIS
fdisk [-uc] [-b sectorsize] [-C cyls] [-H heads] [-S sects] device

   fdisk -l [-u] [device...]

   fdisk -s partition...

   fdisk -v

   fdisk -h

DESCRIPTION
fdisk (in the first form of invocation) is a menu-driven program for creation and manipulation of partition tables. It under‐
stands GPT (experimental for now), MBR, Sun, SGI and BSD partition tables.

   fdisk does not use DOS-compatible mode and cylinders as display units by default.  The  old  deprecated  DOS  behavior  can  be
   enabled with the '-c=dos -u=cylinders' command-line options.

   Hard  disks can be divided into one or more logical disks called partitions.  This division is recorded in the partition table,
   found in sector 0 of the disk.  (In the BSD world one talks about `disk slices' and a `disklabel'.)

   Linux needs at least one partition, namely for its root file system.  It can use swap files and/or  swap  partitions,  but  the
   latter  are more efficient.  So, usually one will want a second Linux partition dedicated as swap partition.  On Intel-compati‐
   ble hardware, the BIOS that boots the system can often only access the first 1024 cylinders of the disk.  For this reason  peo‐
   ple with large disks often create a third partition, just a few MB large, typically mounted on /boot, to store the kernel image
   and a few auxiliary files needed at boot time, so as to make sure that this stuff is accessible to the BIOS.  There may be rea‐
   sons of security, ease of administration and backup, or testing, to use more than the minimum number of partitions.

DEVICES
The device is usually /dev/sda, /dev/sdb or so. A device name refers to the entire disk. Old systems without libata (a
library used inside the Linux kernel to support ATA host controllers and devices) make a difference between IDE and SCSI disks.
In such cases the device name will be /dev/hd* (IDE) or /dev/sd* (SCSI).

由于每个人的环境不一样,我们可以先用
df 这个命令找出可用的磁盘文件名,然后再用fdisk查阅

下面举个例子
linux 查看磁盘分区_第1张图片linux 查看磁盘分区_第2张图片不想这么复杂 直接输入命令
fdisk -l
linux 查看磁盘分区_第3张图片

你可能感兴趣的:(linux命令)