Linux系統中的磁盤管理
## 1.本地存儲設備的識別
fdisk -l ##真實存在的設備
cat /proc/partition ##系統識別的設備
blkid ##系統可使用的設備
df ##系統正在掛載的設備
#2.設備的掛載和卸載
1.設備名稱
/dev/xdx ##/dev/hd0 /dev/hd1 /dev/sdb /dev/sda1 /dev/sda2 /dev/sdb1
/dev/sr0 ##光驅
/dev/mapper/* ##虛擬設備
2.設備的掛載
mount 設備 掛載點
mount /dev/sdb1 /mnt ##掛載sdb1到mnt
umount /mnt| /dev/sdb1 ##卸載
mount -o ro /dev/sdb1 /mnt ##只讀掛載
mount ##查看掛載信息
mount -o remount,rw /dev/sdb1 | /mnt ##重寫讀寫掛載
#3.解決設備正忙問題
方法1
fuser -kvm /mnt
umount /mnt
方法2
lsof /mnt
#4.磁盤分區
1.磁盤0磁道1扇區的512字節中記錄的信息如下
512=446 + 64 + 2
^ ^ ^
mbr(主引導記錄) mpt(主分區標) 55a(硬盤的有效性標示)
硬盤分區標
64
1個分區佔用16個字節
1塊硬盤最多可以劃分4個分區
#5.分區步驟
1.fdisk -l
2.fdisk /dev/vdb
m
Command action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition ##刪除
g create a new empty GPT partition table
G create an IRIX (SGI) partition table
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 ##修改分區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 ##新建
Partition type:
p primary (2 primary, 0 extended, 2 free)
e extended
Select (default p):
Using default response p ##主分區
Partition number (3,4, default 3): ##id用默認
First sector (411648-20971519, default 411648): ##分區起始
Using default value 411648
Last sector, +sectors or +size{K,M,G} (411648-20971519, default 20971519): +100M
Partition 3 of type Linux and of size 100 MiB is set
瀋陽哪個醫院看×××好 http://mobile.024sdyy.com/
瀋陽×××醫院哪裏好 http://mobile.99syjk.com/
瀋陽×××醫院那個好 http://mobile.shenda120.com/