国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Linux > 正文

Linux下磁盤掛載

2024-06-28 13:20:05
字體:
供稿:網(wǎng)友
linux下磁盤掛載

公司硬盤不夠用了,新買了一個存儲,需要掛載到現(xiàn)在的系統(tǒng)上。前期的步驟就不說了,運維全部搞定,無非是硬件和網(wǎng)絡(luò)那一套,這里只說分配到本人后在Linux下如何掛載。

具體步驟如下:

1、查看是否已經(jīng)分配

[root@localhost home]# fdisk -l磁盤 /dev/sda:64.4 GB, 64424509440 字節(jié),125829120 個扇區(qū)Units = 扇區(qū) of 1 * 512 = 512 bytes扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)磁盤標(biāo)簽類型:dos磁盤標(biāo)識符:0x000a47ad   設(shè)備 Boot      Start         End      Blocks   Id  System/dev/sda1   *        2048     1026047      512000   83  Linux/dev/sda2         1026048   125829119    62401536   8e  Linux LVM磁盤 /dev/sdb:1649.3 GB, 1649267441664 字節(jié),3221225472 個扇區(qū)Units = 扇區(qū) of 1 * 512 = 512 bytes扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)

2、發(fā)現(xiàn)有磁盤,路徑為/dev/sdb。然后使用fdisk命令進行建立分區(qū)

[root@localhost home]# fdisk /dev/sdb

fdisk命令如下:

命令(輸入 m 獲取幫助):m命令操作   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   u   change display/entry units   v   verify the partition table   w   write table to disk and exit   x   extra functionality (experts only)

3、然后先新建分區(qū)(我這里因為要存儲大數(shù)據(jù)庫文件 所以邏輯全部是一個分區(qū))

命令(輸入 m 獲取幫助):nPartition type:   p   primary (0 primary, 0 extended, 4 free)   e   extendedSelect (default p): Using default response p分區(qū)號 (1-4,默認 1):起始 扇區(qū) (2048-3221225471,默認為 2048):將使用默認值 2048Last 扇區(qū), +扇區(qū) or +size{K,M,G} (2048-3221225471,默認為 3221225471):將使用默認值 3221225471分區(qū) 1 已設(shè)置為 Linux 類型,大小設(shè)為 1.5 TiB

4、最后保存分區(qū)

命令(輸入 m 獲取幫助):wThe partition table has been altered!Calling ioctl() to re-read partition table.正在同步磁盤。

5、使用fdisk -l命令查看,已經(jīng)有分區(qū)了

磁盤 /dev/sdb:1649.3 GB, 1649267441664 字節(jié),3221225472 個扇區(qū)Units = 扇區(qū) of 1 * 512 = 512 bytes扇區(qū)大小(邏輯/物理):512 字節(jié) / 512 字節(jié)I/O 大小(最小/最佳):512 字節(jié) / 512 字節(jié)磁盤標(biāo)簽類型:dos磁盤標(biāo)識符:0xe0bc0098   設(shè)備 Boot      Start         End      Blocks   Id  System/dev/sdb1            2048  3221225471  1610611712   83  Linux

6、建好分區(qū)后要格式化分區(qū),建立文件系統(tǒng)

[root@localhost home]# mkfs.xfs -f /dev/sdsda   sda1  sda2  sdb   sdb1  [root@localhost home]# mkfs.xfs -f /dev/sdb1meta-data=/dev/sdb1              isize=256    agcount=4, agsize=100663232 blks         =                       sectsz=512   attr=2, projid32bit=1         =                       crc=0        finobt=0data     =                       bsize=4096   blocks=402652928, imaxpct=5         =                       sunit=0      swidth=0 blksnaming   =version 2              bsize=4096   ascii-ci=0 ftype=0log      =internal log           bsize=4096   blocks=196607, version=2         =                       sectsz=512   sunit=0 blks, lazy-count=1realtime =none                   extsz=4096   blocks=0, rtextents=0

7、這樣文件系統(tǒng)就建好了,然后選擇一個掛載點掛上就可以了,我掛載在/home/data/ 下了

[root@localhost home]# mount /dev/sdb1 /home/data/

8、查看一下掛載是否成功了

[root@localhost home]# df -TH /home/data/文件系統(tǒng)       類型  容量  已用  可用 已用% 掛載點/dev/sdb1      xfs   1.7T   34M  1.7T    1% /home/data

9、修改一下系統(tǒng)配置加入下列行到/etc/fstab,讓系統(tǒng)啟動后自動掛載,否則有可能會掉啊

/dev/sdb1  /home/data xfs  defaults  0  0


發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 安丘市| 调兵山市| 太原市| 滦南县| 罗平县| 晋城| 奈曼旗| 涿鹿县| 西林县| 景德镇市| 金秀| 三门峡市| 安化县| 定安县| 四子王旗| 南陵县| 南投县| 枣强县| 大兴区| 大庆市| 金湖县| 曲沃县| 集贤县| 彰化市| 道孚县| 咸丰县| 建阳市| 建湖县| 纳雍县| 手机| 柘荣县| 普安县| 囊谦县| 乌兰浩特市| 无为县| 清河县| 德化县| 望都县| 元阳县| 永州市| 卓资县|