天天看點

linux磁盤管理

# free -m

# fdisk -l

parted     大于2T的分區工具

parted  /dev/sdb   mkpart   primary   ext3  0 2T

人品   能力  

忠誠  敬業    自動自發  負責   注重效率  結果導向 善于溝通  合作 積極進取 低調  節約  感恩

主分 區  擴充分區     邏輯分區 

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)

n

   e   extended

   p   primary partition (1-4)

1

Last cylinder, +cylinders or +size{K,M,G} (1-130, default 130): +500M

   Device Boot      Start         End      Blocks   Id  System

/dev/sdb1               1          20      160618+  83  Linux

/dev/sdb2              21         130      883575    5  Extended

# partprobe   /dev/sdb   通知系統核心 分區改變了

t     L

/dev/sdb1               1          20      160618+  8e  Linux LVM

This filesystem will be automatically checked every 22 mounts or

180 days, whichever comes first.  Use tune2fs -c or -i to override.

# tune2fs -c -1 /dev/sdb1

tune2fs 1.41.12 (17-May-2010)

Setting maximal mount count to -1

# mount /dev/sdb1 /mnt

w  儲存

parted    GNU磁盤分區工具,,大于2T

# parted  /dev/sdb

GNU Parted 2.1

使用 /dev/sdb

Welcome to GNU Parted! Type 'help' to view a list of

commands.

(parted) rm       

分區編号? 1

1(parted) mklabel  gpt

  警告: The existing disk label on /dev/sdb will be

destroyed and all data on this disk will be lost. Do you

want to continue?

 是/Yes/否/No? yes  

(parted) p       

Model: VMware, VMware Virtual S (scsi)

Disk /dev/sdb: 1074MB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

(parted) mkpart primary 0 500

警告: The resulting partition is not properly aligned for

best performance.

忽略/Ignore/放棄/Cancel? Ignore

Number  Start   End    Size   File system  Name     标志

 1      17.4kB  500MB  500MB               primary

(parted) mkpart  logical 501 1024

 2      501MB   1024MB  523MB               logical

# mkfs.ext4    /dev/sdb1

# df -hT

parted  /dev/sdb   mklabel    gpt

parted  /dev/sdb   mkpart     primary 0 500   

parted  /dev/sdb   mkpart     logical 501 1024

parted  /dev/sdb     p

mkfs.ext4    /dev/sdb1

mount /dev/sdb1  /tmp/

mount -t   檔案系統類型   -o  挂載的選項   -a

umount   -lf 強制解除安裝 

dd   轉換檔案   - convert and copy a file

dd  if=/dev/sda   of=mbr.bin  bs=512   count=1

mkfs.ext4     

df -h

du -sh 檢視檔案及目錄大小

# du -sh /etc/*                                h人類可讀

# du -sh /etc

27M     /etc

 tune2fs    -    adjust   tunable   filesystem   parameters   on

       ext2/ext3/ext4 filesystems

dumpe2fs - dump ext2/ext3/ext4 filesystem infor-

       mation

繼續閱讀