色yeye在线视频观看_亚洲人亚洲精品成人网站_一级毛片免费播放_91精品一区二区中文字幕_一区二区三区日本视频_成人性生交大免费看

當前位置:首頁 > 嵌入式培訓 > 嵌入式學習 > 講師博文 > Linux文件系統管理

Linux文件系統管理 時間:2018-09-27      來源:未知

一、使用 ext4、xfs 格式化磁盤并掛載,實現重啟后可自動掛載

1、ext4 格式化磁盤:

# fdisk -l 查看磁盤信息

[root@Demon /]# fdisk -l

Disk /dev/sda: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000d62df

Device Boot Start End Blocks Id System

/dev/sda1 * 1 52 409600 83 Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2 52 574 4194304 82 Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

/dev/sda3 574 13055 100252672 83 Linux

# mkfs -t ext4 /dev/sda3 -t 是格式化后的磁盤格式,/dev/sda3 是將要格式化的磁盤

# mount /dev/sda3 /mnt/sda 將 /dev/sda3 掛載到 /mnt/sda 下

2、xfs 格式化磁盤:

格式化 xfs 需要用到 xfs工具集,先下載xfsprogs

# yum install xfsprogs

# mkfs.xfs -f /dev/sda3 -f 參數的作用是如果當前要格式化的磁盤已經是其他格式的文件系統,則覆蓋

3、實現重啟自動掛載

# vim /etc/fstab 磁盤掛載文件,要掛載的文件系統格式不同,掛載的參數也不同

a) ext3 / ext4 格式磁盤的掛載,在文件中加入下面參數:

/dev/sda? mount_to_file ext3 default 0 0

上面的 ? 指的是你要掛載的磁盤的盤符,mount_to_file 是你要把磁盤掛載到哪,ext3 是你要掛載的磁盤的格式,default 指明按照默認參數掛載, 0 0 表示開機不檢查

b) fat32 格式磁盤的掛載,在文件中加入下面參數:

/dev/sda? mount_to_file vfat user,rw,utf8,umask=000 0 1

這里的?和 mount_to_file 跟上面的一樣,vfat 為文件格式,user,rw指的是給用戶讀寫的權限,utf8加上后會將Windows下的中文轉換為 utf8格式,umask=000 指的是給

所有用戶賦予了讀寫的權限, 0 0 表示開機檢查

二、進行磁盤分區

# fdisk 參數說明

a :指定啟動分區

d :刪除一個存在的分區

l :顯示分區 ID 號的列表

m:查看 fdisk 命令幫助

n :創建一個新的分區

p :顯示分區列表

t :修改分區 ID 號

w:對分區表的修改保存,保存后會立即生效

# 對 /dev/sda3 磁盤進行分區

[root@Demon /]# fdisk /dev/sda (這里沒有盤符)

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to

switch off the mode (command 'c') and change display units to

sectors (command 'u').

Command (m for help): p (查看磁盤信息)

Disk /dev/sda: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000d62df

Device Boot Start End Blocks Id System

/dev/sda1 * 1 52 409600 83 Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2 52 574 4194304 82 Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

/dev/sda3 574 13055 100252672 83 Linux

Command (m for help): d (刪除磁盤)

Partition number (1-4): 3 (刪除 sda3)

Command (m for help): p

Disk /dev/sda: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000d62df

Device Boot Start End Blocks Id System

/dev/sda1 * 1 52 409600 83 Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2 52 574 4194304 82 Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

Command (m for help): n (創建新的分區)

Command action

e extended

p primary partition (1-4) (主分區)

e (擴展分區)

Partition number (1-4): 4

First cylinder (574-13054, default 574): (選擇分區起始柱面)

Using default value 574

Last cylinder, +cylinders or +size{K,M,G} (574-13054, default 13054): (選擇分區結束柱面)

Using default value 13054

Command (m for help): p

Disk /dev/sda: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000d62df

Device Boot Start End Blocks Id System

/dev/sda1 * 1 52 409600 83 Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2 52 574 4194304 82 Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

/dev/sda4 574 13054 100251327 5 Extended

Command (m for help): n

Command action

l logical (5 or over)

p primary partition (1-4)

l (創建邏輯分區)

First cylinder (574-13054, default 574):

Using default value 574

Last cylinder, +cylinders or +size{K,M,G} (574-13054, default 13054):

Using default value 13054

Command (m for help): p

Disk /dev/sda: 107.4 GB, 107374182400 bytes

255 heads, 63 sectors/track, 13054 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

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

I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk identifier: 0x000d62df

Device Boot Start End Blocks Id System

/dev/sda1 * 1 52 409600 83 Linux

Partition 1 does not end on cylinder boundary.

/dev/sda2 52 574 4194304 82 Linux swap / Solaris

Partition 2 does not end on cylinder boundary.

/dev/sda4 574 13054 100251327 5 Extended

/dev/sda5 574 13054 100251295+ 83 Linux

接下來格式化分區

# mkfs -t ext4 /dev/sda4

三、查看磁盤容量

# df -lh

df 命令參數:

-a 全部文件系統列表

-h 方便閱讀顯示,一般用來查找大文件

-H 相當于 -h ,不過1k = 1000 而不是 1024

-i 顯示 inode 信息,inode包含的信息:文件的字節數,擁有者id,組id,權限,改動時間,鏈接數,數據block的位置,

不表示文件大小

-k 區塊為1024字節

-l 只顯示本地文件系統

-m 區塊為1048576 字節

--no-sync 忽略sync 命令

-P 輸出格式為 POSIX

--sync 在取得磁盤信息前,先執行 sync 命令

-T 文件系統類型

上一篇:Linux操作系統引導

下一篇:Linux 系統目錄的作用

熱點文章推薦
華清學員就業榜單
高薪學員經驗分享
熱點新聞推薦
前臺專線:010-82525158 企業培訓洽談專線:010-82525379 院校合作洽談專線:010-82525379 Copyright © 2004-2022 北京華清遠見科技集團有限公司 版權所有 ,京ICP備16055225號-5京公海網安備11010802025203號

回到頂部

主站蜘蛛池模板: 亚洲欧美日韩在线资源观看 | 中文字幕在线永久在线视频 | zziizzii亚洲日本少妇 | 欧洲肉欲K8播放毛片 | 久久97超碰色中文字幕蜜芽 | 人人妻人人澡人人爽欧美一区双 | 亚洲成AV人片久久 | 夜夜躁狠狠躁日日躁 | 免费做A爰片久久毛片A片 | 国产一区二区三区不卡在线看 | 欧美又大又粗无码视频 | 欧美の无码国产の无码影院 | 太粗太大弄死我了l毛片 | 精品日韩亚洲AV无码一区破坏 | 中文字幕一区在线观看视频 | 亚洲精品456在线观看 | 亚洲国产高清在线一区二区三区 | 国产精品网站在线免费观看 | 99久久精品九九亚洲精品 | 精品人妻无码区二区三区 | 中文字幕一区二区在线观看 | 国产高潮流白浆免费视频 | 亚洲精品久久久久中文第一幕 | 脱了老师的裙子猛然进入 | 国产无套内射久久久国产 | 久久天天躁狠狠躁夜夜躁2020 | 欧美人体一区二区视频 | 四虎亚洲精品私库AV在线 | 国产成人啪精品视频免费网 | 巨爆乳中文字幕爆乳区 | 色欲aⅴ亚洲情无码AV蜜桃 | 怡红院A∨人人爰人人爽 | 亚洲日韩国产精品第一页一区 | 忘忧草在线影院WWW日本二 | 人人超人人超碰超国产 | 久久久久久天堂 | 男人天堂视频在线 | 亚洲AV第一成肉网肉片AV | 欧洲av在线播放 | 97国产婷婷综合在线视频 | 草久久久久久久 |