Was this page helpful?

分割 Format

    DF查詢目前掛載磁區
    umount卸載磁區
    fdisk分割磁區

    • -l 查詢目前分割狀態
    • command
    • p 查詢硬碟分割狀態
    • d 刪除磁區
    • n 新件分割區 e 延伸分割區 p主分割區(只能有四個)
    • w 寫入

    mke2fs格式化硬碟
     

    以下操作會將硬碟內的資料完全清除,操作實請先確定硬碟內已無資料後在操作


    [[email protected] root]$ df '查尋目前掛載的磁區,所以目前掛載上/tem/mnt/disc0_1
    Filesystem           1k-blocks      Used Available Use% Mounted on
    /dev/root                 3008      3008         0 100% /
    /dev/discs/disc0/part1   3903760   2852908   1050852  73%
    /tmp/mnt/disc0_1
    [[email protected] root]$ umount /tmp/mnt/disc0_1 '卸載/tmp/mnt/disc0_1
    [[email protected] root]$ df
    Filesystem           1k-blocks      Used Available Use% Mounted on
    /dev/root                 3008      3008         0 100% /

    [[email protected] root]$ fdisk -l '查尋目前分割情況,硬碟/dev/ide/host0/bus0/target0/lun0/disc是一個8G大小的磁碟裡面有一個分割區,分割區/dev/ide/host0/bus0/target0/lun0/part1為一個NTFS的分割區,在這我們要改成ext3

    Disk /dev/ide/host0/bus0/target0/lun0/disc: 8019 MB, 8019099648 bytes
    255 heads, 63 sectors/track, 974 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

                                    Device Boot    Start       End    Blocks   Id  S
    ystem
    /dev/ide/host0/bus0/target0/lun0/part1               1         974     7823623+
     83  HPFS/NTFS

    [[email protected] root]$ fdisk /dev/ide/host0/bus0/target0/lun0/disc '進入/dev/ide/host0/bus0/target0/lun0/disc管理分割區

    Command (m for help): d '刪除分割區
    Selected partition 1

    Command (m for help): p '查詢狀態分割區/dev/ide/host0/bus0/target0/lun0/part1已被刪除

    Disk /dev/ide/host0/bus0/target0/lun0/disc: 8019 MB, 8019099648 bytes
    255 heads, 63 sectors/track, 974 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

                                    Device Boot    Start       End    Blocks   Id  S
    ystem


    Command (m for help): n '新增分割區
    Command action
       e   extended
       p   primary partition (1-4)

    p '分割一個主分割區
    Partition number (1-4): 1 '第一個主分割區
    First cylinder (1-974, default 1):
    Using default value 1
    Last cylinder or +size or +sizeM or +sizeK (1-974, default 974):
    Using default value 974


    Command (m for help): p '查詢狀態已分割出/dev/ide/host0/bus0/target0/lun0/part1這個新的分割區

    Disk /dev/ide/host0/bus0/target0/lun0/disc: 8019 MB, 8019099648 bytes
    255 heads, 63 sectors/track, 974 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

                                    Device Boot    Start       End    Blocks   Id  S
    ystem
    /dev/ide/host0/bus0/target0/lun0/part1               1         974     7823623+
     83  Linux


    Command (m for help): w '寫入&離開
    The partition table has been altered!

    Calling ioctl() to re-read partition table.
    Syncing disks.

    [[email protected] root]$ fdisk -l'查尋目前分割情

    Disk /dev/ide/host0/bus0/target0/lun0/disc: 8019 MB, 8019099648 bytes
    255 heads, 63 sectors/track, 974 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes

                                    Device Boot    Start       End    Blocks   Id  S
    ystem
    /dev/ide/host0/bus0/target0/lun0/part1               1         974     7823623+
     83  Linux

    [[email protected] root]$ mke2fs -j /dev/ide/host0/bus0/target0/lun0/part1'將割出/dev/ide/host0/bus0/target0/lun0/part1,格式化為EXT3
    mke2fs 1.38 (30-Jun-2005)
    Filesystem label=
    OS type: Linux
    Block size=4096 (log=2)
    Fragment size=4096 (log=2)
    979200 inodes, 1955905 blocks
    97795 blocks (5.00%) reserved for the super user
    First data block=0
    60 block groups
    32768 blocks per group, 32768 fragments per group
    16320 inodes per group
    Superblock backups stored on blocks:
            32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

    Writing inode tables: done
    Creating journal (32768 blocks):done
    Writing superblocks and filesystem accounting information: done
    This filesystem will be automatically checked every 33 mounts or
    180 days, whichever comes first.  Use tune2fs -c or -i to override.

    [[email protected] root]$reboot

    asus login: admin
    Password:
    [[email protected] root]$ df
    Filesystem           1k-blocks      Used Available Use% Mounted on
    /dev/root                 3008      3008         0 100% /
    /dev/discs/disc0/part1   7700668    131228   7178260   2% /tmp/mnt/disc0_1

     

    Was this page helpful?
    標籤 (Edit tags)
    • No tags
    您必須 登入 才能發佈評論。
    Powered by MindTouch Core