免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1319 | 回复: 0
打印 上一主题 下一主题

linux查看分区类型 z [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-09-03 11:34 |只看该作者 |倒序浏览

                                linux查看分区类型:     fdisk  -l    df -Th    parted----------------------------------------详解-------------------------------------fdisk -l 命令查看一下    # fdisk  -l    Disk /dev/sda: 12.8 GB, 12884901888 bytes    255 heads, 63 sectors/track, 1566 cylinders    Units = cylinders of 16065 * 512 = 8225280 bytes    Disk identifier: 0x0003bbd5        Device Boot         Start        End      Blocks    Id  System    /dev/sda1   *           1        1494    12000523+  83  Linux    /dev/sda2            1495        1566      578340    5  Extended    /dev/sda5            1495        1566      578308+  82  Linux swap / Solaris查看硬盘是什么分区,使用fdisk -l,但是看不到文件系统类型,只能看到分区类型,以Redhat 9为例:        [root@redhat9 root]# fdisk -l                Disk /dev/sda: 8589 MB, 8589934592 bytes        255 heads, 63 sectors/track, 1044 cylinders        Units = cylinders of 16065 * 512 = 8225280 bytes                  Device Boot    Start       End    Blocks   Id  System        /dev/sda1   *         1        13    104391   83  Linux        /dev/sda2            14      1012   8024467+  83  Linux        /dev/sda3          1013      1044    257040   82  Linux swapdf -Th 命令    友好一些,容量大小是以易读的方式显示的,而且它是显示所有分区,并不是一个分区。这个命令最方便。        [root@redhat9 root]# df -Th        Filesystem    Type    Size  Used Avail Use% Mounted on        /dev/sda2     ext3    7.6G  2.3G  4.9G  32% /        /dev/sda1     ext3     99M  9.3M   85M  10% /boot        none         tmpfs     62M     0   62M   0% /dev/shmparted    倒是有点复杂了,因为它的功能很强,redhat 9中的parted不支持-p参数,但是用parted命令进入后可以用p命令显示出当前的磁盘分区和文件系统情况:        # parted        GNU Parted 1.6.3        Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.        This program is free software, covered by the GNU General Public License.                This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without        even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU        General Public License for more details.                Using /dev/sda        Information: The operating system thinks the geometry on /dev/sda is 1044/255/63.  Therefore,        cylinder 1024 ends at 8032.499M.        (parted) p                                                                                Disk geometry for /dev/sda: 0.000-8192.000 megabytes        Disk label type: msdos        Minor    Start       End     Type      Filesystem  Flags        1          0.031    101.975  primary   ext3        boot        2        101.975   7938.369  primary   ext3                3       7938.369   8189.384  primary   linux-swap                ==============================================================        ubuntu下使用parted:                        root@bai-desktop:/home/bai# parted         GNU Parted 1.7.1        Using /dev/sda        Welcome to GNU Parted! Type 'help' to view a list of commands.        (parted) help                                                                       check NUMBER                             do a simple check on the file system          cp [FROM-DEVICE] FROM-NUMBER TO-NUMBER   copy file system to another partition          help [COMMAND]                           prints general help, or help on COMMAND          mklabel LABEL-TYPE                       create a new disklabel (partition table)          mkfs NUMBER FS-TYPE                      make a FS-TYPE file system on partititon NUMBER          mkpart PART-TYPE [FS-TYPE] START END     make a partition          mkpartfs PART-TYPE FS-TYPE START END     make a partition with a file system          move NUMBER START END                    move partition NUMBER          name NUMBER NAME                         name partition NUMBER as NAME          print [free|NUMBER|all]                  display the partition table, a partition, or all devices          quit                                     exit program          rescue START END                         rescue a lost partition near START and END          resize NUMBER START END                  resize partition NUMBER and its file system          rm NUMBER                                delete partition NUMBER          select DEVICE                            choose the device to edit          set NUMBER FLAG STATE                    change the FLAG on partition NUMBER          toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER          unit UNIT                                set the default unit to UNIT          version                                  displays the current version of GNU Parted and copyright information        (parted) print                                                                            Disk /dev/sda: 12.9GB        Sector size (logical/physical): 512B/512B        Partition Table: msdos                Number  Start   End     Size    Type      File system  Flags         1      32.3kB  12.3GB  12.3GB  primary   ext3         boot          2      12.3GB  12.9GB  592MB   extended                             5      12.3GB  12.9GB  592MB   logical   linux-swap                        (parted) quit                                                                     Information: Don't forget to update /etc/fstab, if necessary.     
               
               
               
               
               
               
               

本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/484/showart_1162824.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP