Linux 分区命令随查

sudo fdisk -l

sudo fdisk /dev/sdb

help command

Command (m for help): m

Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
m print this menu
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition‘s system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
255 heads, 63 sectors/track, 1961 cylinders, total 31506432 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
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 2 614457 307228 b W95 FAT32
/dev/sdb2 614459 12001823 5693682+ af HFS / HFS+

delete patition

Command (m for help): d
Partition number (1-4): 1

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
255 heads, 63 sectors/track, 1961 cylinders, total 31506432 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
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb2 614459 12001823 5693682+ af HFS / HFS+

Command (m for help): d
Selected partition 2

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
255 heads, 63 sectors/track, 1961 cylinders, total 31506432 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
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System

new patitioin

Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-31506431, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-31506431, default 31506431):
Using default value 31506431

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
255 heads, 63 sectors/track, 1961 cylinders, total 31506432 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
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 2048 31506431 15752192 83 Linux

change patition type

Command (m for help): t
Partition number (1-4): 1
Hex code (type L to list codes): b
Changed system type of partition 1 to b (W95 FAT32)

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
48 heads, 6 sectors/track, 109397 cylinders, total 31506432 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
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 2048 2000000 998976+ b W95 FAT32
/dev/sdb2 2000001 30000000 14000000 83 Linux
/dev/sdb3 30000001 31506431 753215+ 83 Linux

Command (m for help): t
Partition number (1-4): 2
Hex code (type L to list codes): 87
Changed system type of partition 2 to 87 (NTFS volume set)

Command (m for help): p

Disk /dev/sdb: 16.1 GB, 16131293184 bytes
48 heads, 6 sectors/track, 109397 cylinders, total 31506432 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
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 2048 2000000 998976+ b W95 FAT32
/dev/sdb2 2000001 30000000 14000000 87 NTFS volume set
/dev/sdb3 30000001 31506431 753215+ 83 Linux

sudo mkfs -t ntfs /dev/sdb2

Cluster size has been automatically set to 4096 bytes.
Initializing device with zeroes: 3% ....

时间: 2025-01-16 14:23:52

Linux 分区命令随查的相关文章

Linux常用命令速查备忘

Linux常用命令速查备忘 PS:备忘而已,详细的命令参数说明自己man 一. 启动,关机,登入,登出相关命令 [login] 登录 [logout] 登出 [exit] 登出 [shutdown] 停止系统 [halt] 停止系统 [reboot] 重启动 [poweroff] 切断电源 [sync] 把内存里的内容写入磁盘 [lilo] 安装lilo启动管理程序 [grub] 安装lilo启动管理程序 二. Shell相关命令 [chsh] 切换Shell [history] 显示命令履历

linux分区命令parted的用法

parted的适用场景 创建操作大于2T的分区 一般情况下,我们都是选择使用fdisk工具来进行分区,但是目前在实际生产环境中使用的磁盘空间越来越大,呈TiB级别增长:而常用的fdisk这个工具对分区是有大小限制的,它只能划分小于2T的磁盘,所以在划大于2T磁盘分区的时候fdisk就无法满足要求了:这个时候有2个方法,其一是通过卷管理来实现,其二就是通过parted工具来实现对GPT磁盘进行分区操作:这里我们采用parted的方法来实现管理. parted的2种使用方式 交互式 手动按序交互式的

Linux常用命令速查

索引表格 命令 功能简述 目录与文件基本操作 pwd 显示当前目录 ls 列出目录和文件名称 cp 复制文件或目录 mv 移动或更名现有的文件或目录 rm 删除文件或目录 mkdir 新建目录 rmdir 删除空目录 file 显示文件类型 stat 显示文件或文件系统的详细信息 du 显示文件或目录大小 touch 更改文件或目录的时间标记 ln 建立链接文件 查找文件或目录 which 在$PATH设定的目录范围查找指定文件 whereis 查找文件(只用于查找:二进制文件.源代码文件.ma

Linux 常用命令速查

1.在指定文件夹下递归查询包含一个字符串的文件(列出的文件内容片段) grep -r   “要查找的串”    文件路径   如  : grep -r  "helloworld"   .       #在当前目录下递归查找 “helloworld” 字符串 2.  递归查找文件名 (列出文件名)   如:find . -name   "*.log"              #在当前目录中递归列出以log为扩展名的文件     3 . 查看操作系统位数 arch 4

fdisk磁盘分区命令

man fdisk查看技术文档: fdisk - Partition table manipulator for Linux 分区命令 常用选项: -l [设备名称]:有设备名称时会列出分区的内容,若无则列出整个文件系统的所有分区列出 [[email protected] ~]# fdisk -l Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylind

Linux命令速查手册,超详细Linux命令教程

一.常用命令速查 ls cd pwd cat more less tail head cp scp mv mkdir rmdir touch rm ps kill top free clear tree wc stat   以上是常用命令速查表,以下是命令详解. 二.Linux 文件/目录管理类命令详解 Linux命令详解之–ls命令 Linux命令详解之–cd命令 Linux命令详解之—pwd命令 Linux命令详解之—cp命令 Linux命令详解之–scp命令 Linux命令详解之–mv命令

Linux 磁盘结构之 --- fdisk分区命令

一.fdisk 的介绍  fdisk - Partition table manipulator for Linux ,译成中文的意思是磁盘分区表操作工具:其实就是分区工具 . fdsik 能划分磁盘成为若干个区,同时也能为每个分区指定分区的文件系统,比如linux .fat32. linux .linux swap .fat16 以及其实类Unix类操作系统的文件系统等:当然我们用fdisk 对磁盘操作分区时,并不是一个终点,我们还要对分区进行格式化所需要的文件系统:这样一个分区才能使用:这和

Linux/Unix 系统分析命令速查手册

1.Hardware CPU information: cat /proc/cpuinfo 物理core个数: 统计core 逻辑CPU个数:统计processor Memory information: free -m 其中-+buffer是针对OS/App来说的. Disk information: fdisk -l df -h IO 性能: iostat -d -x -k 1 10 此命令属于sysstat包 观察await 平均io operation等待时间 观察%util 一秒中IO

Linux学习命令汇总六——磁盘分区,磁盘挂载,文件系统管理,压缩及归档命令

本章Blog相关Linux知识点 Linux文件系统中的文件是数据的集合,文件系统不仅包含着文件中的数据而且还有文件系统的结构,所有Linux 系统中的文件.目录.软连接及文件保护信息等都存储在其中.按照名称进行存取. 磁盘:磁道,扇区 ,柱面 ,固定角速度 ,平均寻道时间 MBR :master boot recoard 主引导记录 (512字节),存放bootloader (引导加载器 446字节)+ 磁盘分区 (64字节) 一块磁盘最多分为4个主分区 ,或者3主分区1扩展分区  ,磁盘在C