首页 > 系统相关 >Linux fdisk command All In One

Linux fdisk command All In One

时间:2023-07-31 14:55:04浏览次数:46  
标签:4096 sectors bytes dev command Linux fdisk 512 size

Linux fdisk command All In One

disk partition / 磁盘分区

$ fdisk -h

Usage:
 fdisk [options] <disk>         change partition table
 fdisk [options] -l [<disk>...] list partition table(s)

Display or manipulate a disk partition table.

Options:
 -b, --sector-size <size>      physical and logical sector size
 -B, --protect-boot            don't erase bootbits when creating a new label
 -c, --compatibility[=<mode>]  mode is 'dos' or 'nondos' (default)
 -L, --color[=<when>]          colorize output (auto, always or never)
                                 colors are enabled by default
 -l, --list                    display partitions and exit
 -x, --list-details            like --list but with more details
 -n, --noauto-pt               don't create default partition table on empty devices
 -o, --output <list>           output columns
 -t, --type <type>             recognize specified partition table type only
 -u, --units[=<unit>]          display units: 'cylinders' or 'sectors' (default)
 -s, --getsz                   display device size in 512-byte sectors [DEPRECATED]
     --bytes                   print SIZE in bytes rather than in human readable format
     --lock[=<mode>]           use exclusive device lock (yes, no or nonblock)
 -w, --wipe <mode>             wipe signatures (auto, always or never)
 -W, --wipe-partitions <mode>  wipe signatures from new partitions (auto, always or never)

 -C, --cylinders <number>      specify the number of cylinders
 -H, --heads <number>          specify the number of heads
 -S, --sectors <number>        specify the number of sectors per track

 -h, --help                    display this help
 -V, --version                 display version

Available output columns:
 gpt: Device Start End Sectors Size Type Type-UUID Attrs Name UUID
 dos: Device Start End Sectors Cylinders Size Type Id Attrs Boot End-C/H/S Start-C/H/S
 bsd: Slice Start End Sectors Cylinders Size Type Bsize Cpg Fsize
 sgi: Device Start End Sectors Cylinders Size Type Id Attrs
 sun: Device Start End Sectors Cylinders Size Type Id Flags

For more details see fdisk(8).

image

$ fdisk -l
fdisk: cannot open /dev/ram0: 权限不够
fdisk: cannot open /dev/ram1: 权限不够
fdisk: cannot open /dev/ram2: 权限不够
fdisk: cannot open /dev/ram3: 权限不够
fdisk: cannot open /dev/ram4: 权限不够
fdisk: cannot open /dev/ram5: 权限不够
fdisk: cannot open /dev/ram6: 权限不够
fdisk: cannot open /dev/ram7: 权限不够
fdisk: cannot open /dev/ram8: 权限不够
fdisk: cannot open /dev/ram9: 权限不够
fdisk: cannot open /dev/ram10: 权限不够
fdisk: cannot open /dev/ram11: 权限不够
fdisk: cannot open /dev/ram12: 权限不够
fdisk: cannot open /dev/ram13: 权限不够
fdisk: cannot open /dev/ram14: 权限不够
fdisk: cannot open /dev/ram15: 权限不够
fdisk: cannot open /dev/mmcblk0: 权限不够

$ sudo fdisk -l
Disk /dev/ram0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram2: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram3: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram4: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram5: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram6: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram7: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram8: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram9: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram10: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram11: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram12: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram13: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram14: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/ram15: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes


Disk /dev/mmcblk0: 59.45 GiB, 63831015424 bytes, 124669952 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x99d0acec

Device         Boot  Start       End   Sectors  Size Id Type
/dev/mmcblk0p1        8192    532479    524288  256M  c W95 FAT32 (LBA)
/dev/mmcblk0p2      532480 124669951 124137472 59.2G 83 Linux

demos

(

标签:4096,sectors,bytes,dev,command,Linux,fdisk,512,size
From: https://www.cnblogs.com/xgqfrms/p/17592435.html

相关文章

  • linux环境中,如何查看网络设备的序列号?
    通过iplink查看网络设备的序列号 iplink  查询结果中,最左边的一列,就是这个网络接口,在主机上的序列号。......
  • CoaXPress 2.0 FPGA HOST IP Core Linux Demo
      目录Hello-FPGACoaXPress2.0HostFPGAIPCoreLinuxDemo41说明42设备连接73VIVADOFPGA工程74调试说明10图1‑1资料目录4图1‑2VIVADO工程目录结构5图1‑3SDK工程目录结构5图1‑4设备树信息6图1‑5petalinux应用程序6图2‑1ZCU10......
  • Alpine Linux使用入门(Docker视角)
    前言我们在了解AlpineLinux时,多数都应该是从docker系统镜像了解的这个操作系统,今天我们就简单说一下AlpineLinux的基础使用AlpineLinux是一种基于musl和BusyBox的Linux发行版,专为安全性、简单性和资源效率而设计。体积非常小巧,适合用来做Docker镜像。如果你有Centos或者Ubun......
  • Visual Studio 调试技巧[Command Window & Immediate Window ](Tips)
    VisualStudio调试技巧[CommandWindow&ImmediateWindow](Tips)1.immediatewindow定义的一些alias(//z2012-3-1314:04:44PMIS2120alias?Debug.Printalias??Debug.QuickWatchaliasAddProjFile.AddNewProjectaliasaliasTools.Al......
  • Linux网络编程
    1Socket在linux网络编程中我们主要使用套接字Socke进行不同主机上进程间的通信,该套接字提供了透明传输接口使得我们不需要根据协议栈进行手动封装数据包,我们不必在意协议栈上下层之间的具体服务,而是仅需调用提供的api即可套接字通信的一般流程为:创建套接字:在应用程序中使用网......
  • linux中如何修改网络命名空间中veth设备端点的名字?
    查看原有的设备名称为veth1  [root@centos7~]#ipnetnsexecns1iplink1:lo:<LOOPBACK>mtu65536qdiscnoopstateDOWNmodeDEFAULTgroupdefaultqlen1000link/loopback00:00:00:00:00:00brd00:00:00:00:00:005:veth1@if6:<BROADCAST,MULTIC......
  • 第16章 进程管理与SELinux初探
    第16章进程管理与SELinux初探一个程序被加载到内在当中运作,那么在内存中的那个数据就被称为进程(process)。进程是操作系统上非常重要的概念,所有系统上面跑的数据都会以进程的形态存在。16.1什么是进程(process)在Linux系统中:触发任何一个事件时,系统都会将他定义成为一个......
  • 第十三章 Linux帐号管理与ACL权限设定
    第十三章Linux帐号管理与ACL权限设定13.1Linux的帐号与群组13.1.1使用者标识符:UID与GID每个登入的使用者至少都会取得两个ID,一个是使用者ID(UserID,简称UID),一个是群组ID(GroupID,简称GID)。那么文件如何判断他的拥有者与群组呢?其实就是利用UID与GID啦!13.1.2使用者帐号......
  • Linux Redis配置
    Redis是一个开源的高性能键值对存储系统,具有快速、灵活和可扩展的特性。它是一个基于内存的数据结构存储系统,可以用作数据库、缓存和消息代理。Redis的一些主要特点和用途:高性能:Redis数据存储在内存中,因此能够提供极快的读写操作。它采用单线程模型和异步I/O,避免了多线程的......
  • 查linux系统磁盘读写进程问题。
    1、iotop安装以及常见使用方法https://help.aliyun.com/noticelist/articleid/6501633.html?scm=20140722.184.2.173 Linux下的IO统计工具如iostat,nmon等大多数是只能统计到每个磁盘的读写情况,如果想知道每个进程是如何使用IO的就比较麻烦.iotop是一个用来监视磁盘I/O使......