在Linux系统对硬盘分区格式化_Linux服务器维护_黑客防线网安服务器维护基地--Powered by WWW.RONGSEN.COM.CN

在Linux系统对硬盘分区格式化

作者:黑客防线网安网站维护基地 来源:黑客防线网安网站维护基地 浏览次数:0

黑客防线网安网讯:有时候我们经常会对硬盘进行分区,格式化等操作,我相信搞过计算机的同志们在Windows平台下应该都会操作,下面我主要说明一下在Linux平台下对硬盘的分区格式化操作  
    [root@NAT ~]# fdisk -l

    Disk /dev/sda:
有时候我们经常会对硬盘进行分区,格式化等操作,我相信搞过计算机的同志们在Windows平台下应该都会操作,下面我主要说明一下在Linux平台下对硬盘的分区格式化操作  

    [root@NAT ~]# fdisk -l

    Disk /dev/sda: 200.0 GB, 200049647616 bytes

    255 heads, 63 sectors/track, 24321 cylinders

    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System

    /dev/sda1   *           1          25      200781   83  Linux

    /dev/sda2              26        2575    20482875   83  Linux

    /dev/sda3            2576        5125    20482875   83  Linux

    /dev/sda4            5126       24321   154191870    5  Extended

    /dev/sda5            5126        6400    10241406   83  Linux

    /dev/sda6            6401        6655     2048256   82  Linux swap / Solaris

    /dev/sda7            6656       24321   141902113+  83  Linux

    Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes        //未分区的硬盘sdb 1500GB

    255 heads, 63 sectors/track, 182401 cylinders

    Units = cylinders of 16065 * 512 = 8225280 bytes

    Disk /dev/sdb doesn't contain a valid partition table


    [root@NAT ~]# fdisk /dev/sdb

    Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel

    Building a new DOS disklabel. Changes will remain in memory only,

    until you decide to write them. After that, of course, the previous

    content won't be recoverable.


    The number of cylinders for this disk is set to 182401.

    There is nothing wrong with that, but this is larger than 1024,

    and could in certain setups cause problems with:

    1) software that runs at boot time (e.g., old versions of LILO)

    2) booting and partitioning software from other OSs

       (e.g., DOS FDISK, OS/2 FDISK)

    Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

    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&nb sp;  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): n

    Command action

       e   extended

       p   primary partition (1-4)

    p

    Partition number (1-4): 1

    First cylinder (1-182401, default 1):

    Using default value 1

    Last cylinder or +size or +sizeM or +sizeK (1-182401, default 182401): 80000

    Command (m for help): n

    Command action

       e   extended

       p   primary partition (1-4)

    p

    Partition number (1-4): 2

    First cylinder (80001-182401, default 80001):

    Using default value 80001

    Last cylinder or +size or +sizeM or +sizeK (80001-182401, default 182401):

    Using default value 182401

    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): l

     0  Empty           1e  Hidden W95 FAT1 80  Old Minix       be  Solaris boot

     1  FAT12           24  NEC DOS         81  Minix / old Lin bf  Solaris

     2  XEN IX root      39  Plan 9          82  Linux swap / So c1  DRDOS/sec (FAT-

     3  XENIX usr       3c  PartitionMagic  83  Linux           c4  DRDOS/sec (FAT-

     4  FAT16 <32M      40  Venix 80286     84  OS/2 hidden C:  c6  DRDOS/sec (FAT-

     5  Extended        41  PPC PReP Boot   85  Linux extended  c7  Syrinx

     6  FAT16           42  SFS             86  NTFS volume set da  Non-FS data

     7  HPFS/NTFS       4d  QNX4.x          87  NTFS volume set db  CP/M / CTOS / .

     8  AIX             4e  QNX4.x 2nd part 88  Linux plaintext de  Dell Utility

     9  AIX bootable    4f  QNX4.x 3rd part 8e  Linux LVM       df  BootIt

     a  OS/2 Boot Manag 50  OnTrack DM      93  Amoeba          e1  DOS access

     b  W95 FAT32       51  OnTrack DM6 Aux 94  Amoeba BBT      e3  DOS R/O

     c  W95 FAT32 (LBA) 52  CP/M            9f  BSD/OS          e4  SpeedStor

     e  W95 FAT16 (LBA) 53  OnTrack DM6 Aux a0  IBM Thinkpad hi eb  BeOS fs

     f  W95 Ext'd (LBA) 54  OnTrackDM6      a5  FreeBSD         ee  EFI GPT

    10  OPUS            55  EZ-Drive        a6  OpenBSD         ef  EFI (FAT-12/16/

    11  Hidden FAT12    56  Golden Bow      a7  NeXTSTEP        f0  Linux/PA-RISC b

    12  Compaq diagnost 5c  Priam Edisk     a8  Darwin UFS      f1  SpeedStor

    14  Hidden FAT16 <3 61  SpeedStor       a9  NetBSD          f4  SpeedStor

    16  Hidden FAT16    63  GNU HURD or Sys ab  Darwin boot     f2  DOS secondary

    17  Hidden HPFS/NTF 64  Novell Netware  b7  BSDI fs         fd  Linux raid auto

    18  AST SmartSleep  65  Novell Netware  b8  BSDI swap       fe  LANstep

    1b  Hidden W95 FAT3 70  DiskSecure Mult bb  Boot Wizard hid ff  BBT

    1c  Hidden W95 FAT3 75  PC/IX

    Command (m for help): w; The partition table has been altered!

    Calling ioctl() to re-read partition table.

    Syncing disks.

    [root@NAT ~]# df -h

    文件系统              容量  已用 可用 已用% 挂载点

    /dev/sda2              19G  2.6G   16G  14% /

    /dev/sda1             190M   10M  171M   6% /boot

    tmpfs                 248M     0  248M   0% /dev/shm

    /dev/sda7             132G   16G  110G  13% /home

    /dev/sda5             9.5G  3.2G  5.9G  36% /usr

    /dev/sda3              19G  4.1G   14G  23% /var

    [root@NAT ~]# fdisk -l

    Disk /dev/sda: 200.0 GB, 200049647616 bytes

    255 heads, 63 sectors/track, 24321 cylinders

    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System

    /dev/sda1   *           1          25      200781   83  Linux

    /dev/sda2              26        2575    20482875   83  Linux

    /dev/sda3            2576        5125    20482875   83  Linux

    /dev/sda4            5126       24321   154191870    5  Extended

    /dev/sda5            5126        6400    10241406   83  Linux

    /dev/sda6            6401        6655     2048256   82  Linux swap / Solaris

    /dev/sda7            6656       24321   141902113+  83  Linux

    Disk /dev/sdb: 1500.3 GB, 1500301910016 bytes

    255 heads, 63 sectors/track, 182401 cylinders

    Units = cylinders of 16065 * 512 = 8225280 bytes

       Device Boot      Start         End      Blocks   Id  System

    /dev/sdb1               1       80000   642599968+  83  Linux

    /dev/sdb2          80001      182401   822536032+  83  Linux

    [root@NAT

    [root@NAT ~]# mkfs -t ext3 -c /dev/sdb1

    mke2fs 1.39 (29-May-2006)

    Filesystem label=

    OS type: Linux

    Block size=4096 (log=2)

    Fragment size=4096 (log=2)

    80330752 inodes, 160649992 blocks

    8032499 blocks (5.00%) reserved for the super user

    First data block=0

    Maximum filesystem blocks=0

    4903 block groups

    32768 blocks per group, 32768 fragments per group

    16384 inodes per group

    Superblock backups stored on blocks:

            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,

            4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968,

            102400000


 

    黑客防线网安服务器维护方案本篇连接:http://www.rongsen.com.cn/show-4701-1.html
网站维护教程更新时间:2011-01-02 00:56:19  【打印此页】  【关闭
我要申请本站N点 | 黑客防线官网 |  
专业服务器维护及网站维护手工安全搭建环境,网站安全加固服务。黑客防线网安服务器维护基地招商进行中!QQ:29769479

footer  footer  footer  footer