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

首頁 > 網站 > 幫助中心 > 正文

linux云主機掛載硬盤

2024-07-09 22:49:52
字體:
來源:轉載
供稿:網友

1. ssh登錄云主機,查看磁盤狀況

[root@MyCloudServer ~]# fdisk -l

Disk /dev/xvda: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 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: 0x000858c5

 

    Device Boot      Start         End      Blocks   Id  System

/dev/xvda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/xvda2              64        1306     9972736   8e  Linux LVM

 

Disk /dev/xvdb: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 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: 0x00000000

 

從查詢結果看出,一般我們需要掛載的是/dev/xvdb的盤

 

2. fdisk 對/dev/xvdb 進行分區

 

[root@MyCloudServer ~]# fdisk /dev/xvdb

Command (m for help): n

Command action

   e   extended

   p   primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-2610, default 1):

Using default value 1

Last cylinder or +size or +sizeM or +sizeK (1-652, default 2610):

Using default value 2610

 

Command (m for help): w

The partition table has been altered!

 

Calling ioctl() to re-read partition table.

Syncing disks.

 

再次查看分區情況,多出來一個/dev/xvdb1 的區,這個1是我們在前面指定的,如果我們指定2,就變成 xvdb2了。

 

[root@MyCloudServer ~]# fdisk -l

 

Disk /dev/xvda: 10.7 GB, 10737418240 bytes

255 heads, 63 sectors/track, 1305 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: 0x000858c5

    Device Boot      Start         End      Blocks   Id  System

/dev/xvda1   *           1          64      512000   83  Linux

Partition 1 does not end on cylinder boundary.

/dev/xvda2              64        1306     9972736   8e  Linux LVM 

 

Disk /dev/xvdb: 21.5 GB, 21474836480 bytes

255 heads, 63 sectors/track, 2610 cylinders

Units = cylinders of 16065 * 512 = 8225280

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

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

Disk identifier: 0x00000000

 

   Device Boot      Start         End      Blocks   Id  System

/dev/xvdb1               1         652     5237158+  83  Linux

[root@MyCloudServer ~]# 

 

3. 格式化 /dev/xvdb1 分區

 

[root@MyCloudServer ~]# mkfs -t ext3 /dev/xvdb1

mke2fs 1.35 (28-Feb-2004)

Filesystem label=

OS type: Linux

Block size=4096 (log=2)

Fragment size=4096 (log=2)

655360 inodes, 1309289 blocks

65464 blocks (5.00%) reserved for the super user

First data block=0

Maximum filesystem blocks=1342177280

40 block groups

32768 blocks per group, 32768 fragments per group

16384 inodes per group

Superblock backups stored on blocks:

        32768, 98304, 163840, 229376, 294912, 819200, 884736

 

Writing inode tables: done

Creating journal (8192 blocks): done

Writing superblocks and filesystem accounting information: done

 

This filesystem will be automatically checked every 30 mounts or

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

 

4. 在根目錄下創建目錄 并將 /dev/sdb1 掛在到該目錄下

 

[root@MyCloudServer ~]# cd / 

[root@MyCloudServer ~]# mkdir /data

[root@MyCloudServer ~]# ls

bin  boot  data  dev  etc  home  lib  lib64  lost+found  media  mnt  opt  proc  root  sbin  selinux  srv  sys  tmp  usr  var 

[root@MyCloudServer ~]# mount /dev/xvdb1 /data

 

5. 驗證掛載是否成功

[root@MyCloudServer ~]# df -k

Filesystem           1K-blocks      Used Available Use% Mounted on

/dev/xvda1              9131772   7066884   1601012  82% /

none                    454256         0    454256   0% /dev/shm

/dev/xvdb1              5154852     43040   4849956   1% /data

 

6. 設置開機自動掛載

 

[root@MyCloudServer ~]# vi /etc/fstab

在文本最下面添加

/dev/xvdb1               /data                 ext3    defaults        0 0

 

然后保存退出。

 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 凤山县| 工布江达县| 榆树市| 江口县| 安义县| 宁安市| 长沙县| 五莲县| 鞍山市| 华亭县| 涟源市| 邹平县| 秦皇岛市| 武城县| 昌平区| 葵青区| 湘西| 子洲县| 寿阳县| 荆门市| 雷波县| 济南市| 齐齐哈尔市| 泰兴市| 田林县| 来宾市| 上饶县| 秦安县| 庄浪县| 桂平市| 阳春市| 新龙县| 大安市| 那曲县| 开原市| 隆昌县| 喜德县| 冷水江市| 博白县| 莆田市| 海林市|