disk management

partition  -->  format  -->  mount


disk partition mode

         MBR

                  the main partition is not more than 4

                  single partition capacity maximum 2TB

         GPT

                 the main partition is not limited

                 single partition capacity is not limited

                 ** but not suitable for the installation of X86 system.


command:

        fdisk -l                                list partition tables

        fdisk <diskname>           change partition table  (only MBR)

                  m         for help

                  d          delete a partition

                  n          add a new partition

                  w          write table to disk and exit


        parted  (the first disk is default)  change partition table  (MBR or GPT)

                help                                   print the general help

                select [device]                 choose the device to edit

                mklabel [label type]        create a new disk label

                print                                   display the partition table

                mkpart [part-name] [start] [end] make a partition

                rm [number]                     delete partition number

                quit                                     exit program


        mkfs   format disk using specified file system

                mkfs.[file system type] [device]

                mkfs -t [file system type] [device]


mount partition

        the default dir is /mnt

        must mount a partition to an existing directory


        mount -t [file system type] [device] [directory]

        eg. mount -t ext4 /dev/sdb1 /mnt/rt8633  ( * just temporary)


               vi /etc/fstab

           add this:        /dev/sdb1        /mnt/rt8633        ext4        defaults        0 0

           ( * it will mount the specified device automaticlly after OS is restarted)


swap partition

        how to make a swap partition

        1. make a normal linux partiton

        2. modify hexadecimal code of the partiton type                fdisk [device] -> t (change hex code to swap code(L to show all codes))

        3. format swap partition                                                         mkswap [device]

        4. enable swap partition                                                        swapon [device]  /  swapoff [device]

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章