`
wolf_19
  • 浏览: 164233 次
社区版块
存档分类
最新评论

linux的文件分区类型查询

阅读更多

在linux下怎样查看文件分区类型?

可以想象到肯定是使用和分区有关的命令和文件才能实现,我尝试了一下有如下几种(如果有什么不对和需要补充的请给我留言):

1.使用fdisk命令
fdisk /dev/hda
进入fdisk的命令模式,你可以键入m来查看帮助信息
键入p就可以查看hda这个设备的所有分区的文件类型了。
可以键入q来退出fdisk的命令模式

2.使用parted命令
fdisk命令我们经常看到,但是这个命令我们却使用的很少(可能是我自己见识太少了;-)),其实这个命令也是挺强大的,基本上fdisk可以做的parted都可以做到。
parted /dev/hda
进入parted的命令模式,你可以键入help来查看帮助信息。
键入print就可以查看hda这个设备的所有分区的文件类型了。
可以键入quit来退出parted的命令模式


下面是man parted的介绍

PARTED(8)                      GNU Parted Manual                     PARTED(8)

NAME
       GNU Parted - a partition manipulation program

SYNOPSIS
       parted [options] [device [command [options...]...]]

DESCRIPTION
       This  manual page documents briefly the parted command.  Complete docu-
       mentation is distributed with the  package  in  GNU  Info  format;  see
       below.

       parted  is  a  disk  partitioning  and  partition resizing program.  It
       allows you to create, destroy, resize, move and copy ext2, ext3, linux-
       swap,  FAT  and FAT32 partitions. This is useful for creating space for
       new operating systems, reorganising disk usage, and copying data to new
       hard disks.

OPTIONS
       -h, --help
              displays a help message.

       -i, --interactive
              where necessary, prompts for user intervention.

       -s, --script
              never prompts for user intervention.

       -v, --version
              displays the version.

COMMANDS
       [device]
              The block device to partition.

       [command [options]]
              Specifies  a  command  to parted. If no command is given, parted
              will give you a command prompt. Commands are:

              check partition
                     does a simple check on partition.

              cp [source-device] source dest
                     copies the source partition鈙 filesystem on source-device
                     (or  the current device if no other device was specified)
                     to the dest partition on the current device.

              help [command]
                     prints general help, or help on command if specified.

              mkfs partition fs-type
                     make a filesystem fs-type on partition.  fs-type  can  be
                     one of "FAT", "ext2" or "linux-swap".

              mklabel label-type
                     Creates  a new disklabel (partition table) of label-type.
                     label-type should be one of "bsd", "gpt", "loop",  "mac",
                     "mips", "msdos", "pc98" or "sun".

              mkpart part-type [fs-type] start end
                     make  a  part-type  partition with filesystem fs-type (if
                     specified), beginning at start  and  ending  at  end  (in
                     megabytes).  part-type should be one of "primary", "logi-
                     cal" or "extended"

              mkpartfs part-type fs-type start end
                     make a part-type partition with filesystem fs-type begin-
                     ning at start and ending at end (in megabytes)

              move partition start end
                     move  partition  to  start at start and end at end. Note:
                     move never changes the minor number

              name partition name
                     set the name of partition to name. This option works only
                     on  Mac  and  PC98  disklabels. The name can be placed in
                     quotes, if necessary

              print  displays the partition table

              quit   exits parted

              resize partition start end
                     resize the filesystem on partition to start at start  and
                     end at end megabytes

              rm partition
                     deletes partition

              select device
                     choose  device  as  the  current  device  to edit. device
                     should usually be a Linux hard disk device, but it can be
                     a partition, software raid device or a LVM logical volume
                     if that is necessary

              set partition flag state
                     change the state of the flag on partition to state. Flags
                     supported  are: "boot", "root", "swap", "hidden", "raid",
                     "lvm" and "lba".  state should be either "on" or "off"

REPORTING BUGS
       Report bugs to <bug-parted@gnu.org>

SEE ALSO
       fdisk(8), mkfs(8), The parted program is documented fully  in  the  GNU
       partitioning software manual available via the Info system.

AUTHOR
       This manual page was written by Timshel Knoll <timshel@debian.org>, for
       the Debian GNU/Linux system (but may be used by others).


3.使用mount命令
mount一般用来挂载分区的,其实它也可以用来查看分区类型的。
mount --guess-fstype /dev/hda1
但是这个每次只能查看一个分区

4.使用df命令
df本身就是用来查看分区信息的,但是如果你不加上参数,它是不会列出分区类型的。
df -T
加上-T这个参数,就可以列出所有系统挂载的分区的文件类型信息了

5.查看配置文件
当然你可通过查看配置文件来知道分区的文件类型。
cat /etc/fstab
分享到:
评论

相关推荐

    Linux操作系统下常见文件类型分析

    Linux操作系统下常见文件类型分析

    嵌入式Linux文件系统

    嵌入式Linux文件系统的概述 文件系统是指在一个物理设备上的任何文件组织和目录,它构成了Linux系统上所有数据的基础,Linux程序、库、系统文件和用户文件都驻留其中,因此,它是系统中庞大复杂且又是最为基本和重要...

    Linux服务器配置与管理:Linux磁盘分区.pptx

    能够查看操作系统支持的文件系统类型 【思政目标】 磁盘操作涉及数据安全,要培养学生精益求精的工匠精神。 1.1 磁盘分区 1. 什么是分区? 划分具有独立存储功能的区域。 创建分区时已经设置好了硬盘的各项物理参数...

    Linux应用技术:Linux磁盘分区管理.pptx

    修改分区类型 ;课堂练习4;使用Linux命令管理文件系统;课堂练习5;使用Linux命令管理文件系统;拓展:检查分区;使用Linux命令管理文件系统;课堂练习6;课堂练习6;文件系统的简单操作;删除分区;更新分区表;拓展:检查分区...

    Linux查看分区文件系统类型的方法总结

    在Linux 中如何查看分区的文件系统类型,下面总结几种查看分区文件系统类型的方法。下面话不多说了,来随着小编一起学习学习吧 1: df -T 命令查看 这个是最简单的命令,文件系统类型在Type列输出。只可以查看已经...

    用命令行加挂Linux文件系统的方法

    Linux 在启动过程中,会按照/etc/fstab中的设置,把各个分区上的文件系统加挂到对应到加载点上去。本文总结了一下在Linux上不同情况下几种常见加挂文件系统的方法,包括如何加挂FAT/NTFS/smbfs/U盘,以及解决加挂中...

    Linux中常见文件系统格式介绍

    Windows常用的分区格式有三种,分别是FAT16、FAT32、NTFS格式。在Linux操作系统里有Ext2、Ext3、Linux swap和VFAT四种格式。本文详细介绍了这四种Linux文件系统格式。

    Linux操作系统文件链接问题

    在Linux的文件系统中,保存在磁盘分区中的文件不管是什么类型都给它分配一个编号,称为索引节点号。在Linux中多个文件名指向同一索引节点是存在的。一般这种连接就是硬连接。与硬连接相对应,Lnux系统中还存在另一种...

    介绍Linux硬盘系统建立分区步骤

    LINUX相信大家并不陌生了吧,但是LINUX分区我相信还是有许多人不是太熟悉,希望这篇文章可以帮助大家!

    系统分区 linux

    分区类型 主分区:最多只能有4个扩展分区:-》1:最多只能有1个;-》2:主分区加扩展分区最多有4个;-》3:不能写入数据,不能格式化,只能包涵逻辑分区逻辑分区就能写入数据和格式化了 格式化 windows 下面识别的...

    关于linux分区,文件系统,目录结构的概述

    Linux内核读取光驱,硬盘等资源时均通过“设备文件”的形式进行,因此在linux系统中,将硬盘和分区表示为不同的文件。具体表述形式如下: 硬盘:对于IDE接口的硬盘设备,表示为“hdX”形式的文件名:而对于SCSI接口的...

    linux机器根分区硬盘LVM扩展方法

    磁盘分区类型:常见的磁盘分区类型包括主分区、扩展分区和逻辑分区。主分区用于引导操作系统或存储数据,而扩展分区允许创建多个逻辑分区。 分区表创建与管理:使用工具如fdisk或parted,可以创建磁盘上的新分区表...

    Linux应用技术:Linux磁盘分区管理LVM.pptx

    修改/dev/sdc5分区类型为LVM 将/dev/sdc5创建为物理卷 pvcreate /dev/sdc5 对vgtest进行扩容 vgextend vgtest /dev/sdc5 ;拓展:逻辑卷扩容(选学);使用图形化工具system-config-lvm(自学);使用图形化工具system-...

    基于linux的试卷

    安装时Linux分区的文件系统类型一般为ext2或ext3。 C.安装时要进行磁盘分区,如果选择“自动分区”,系统会自动保留硬盘上原来的数据。 D.Linux除了可以从光盘安装外,还可以从网上下载Linux的iso映像文件,从硬盘...

    Linux操作系统文件系统基础知识

    Linux文件结构  文件结构是文件存放在磁盘等存贮设备上的组织方法。主要体现在对文件和目录的组织上。  目录提供了管理文件的一个方便而有效的途径。  Linux使用标准的目录结构,在安装的时候,安装程序就已经为...

    详细分析Linux文件系统

    本片文章针对Linux文件系统从原理到运行机制做了非常详细的理论分析,有助于读者对此深入的理解,以下是具体内容: Linux上的文件系统一般来说就是EXT2或EXT3,但这篇文章并不准备一上来就直接讲它们,而希望结合...

    Linux综合运维思维导图

    硬盘管理 常规使用 所有设备在linux上所生成的文件,都存放在/dev/下 ... t:变更分区类型 w:保存更改并退出 q:放弃更改并退出 parted 特点 最多128个主分区 parted 硬盘文件

    Linux网络操作系统基础:Linux初步使用.ppt

    光盘介质检查 基本配置:语言、键盘、鼠标 安装类型选择: 磁盘分区、创建文件系统: 引导装载程序配置 网络配置DHCP 防火墙、语言支持、时区配置 超级用户设置 选择安装软件包 开始安装 图形界面配置 3.删除Linux ...

    anurbs-0.5.1-cp38-cp38-linux2010-x86-64.whl

    anurbs的Linux文件系统是计算机系统中非常重要的组成部分,它负责存储和管理操作系统、应用程序以及用户数据等各类文件。Linux文件系统不仅具有高效、稳定的特点,还具备强大的可扩展性和灵活性,使其在各种应用场景...

Global site tag (gtag.js) - Google Analytics