美文网首页
磁盘挂载

磁盘挂载

作者: 米开朗基乐 | 来源:发表于2018-04-24 17:47 被阅读0次

Linux新添加的硬盘,需要挂载。方法如下

[root@oracledb /]# fdisk /dev/vdb#进入磁盘初始化
Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel
Building a new DOS disklabel with disk identifier 0xc0fe6104.
Changes will remain in memory only, until you decide to write them.
After that, of course, the previous content won't be recoverable.

Warning: invalid flag 0x0000 of partition table 4 will be corrected by w(rite)

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): n#第一步
Command action
   e   extended
   p   primary partition (1-4)
p#第二步
Partition number (1-4): 1#默认1
First cylinder (1-1040253, default 1): #回车
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-1040253, default 1040253): #回车,默认最大值
Using default value 1040253

Command (m for help): p#第三步,再次查看,下面是刚刚分出来的

Disk /dev/vdb: 536.9 GB, 536870912000 bytes
16 heads, 63 sectors/track, 1040253 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc0fe6104

   Device Boot      Start         End      Blocks   Id  System
/dev/vdb1               1     1040253   524287480+  83  Linux

Command (m for help): w#保存退出
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
[root@oracledb /]# fdisk -l#查看一下,哎~有了

Disk /dev/vda: 42.9 GB, 42949672960 bytes
255 heads, 63 sectors/track, 5221 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: 0x00071419

   Device Boot      Start         End      Blocks   Id  System
/dev/vda1   *           1        5222    41940992   83  Linux

Disk /dev/vdb: 536.9 GB, 536870912000 bytes
16 heads, 63 sectors/track, 1040253 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc0fe6104

   Device Boot      Start         End      Blocks   Id  System
/dev/vdb1               1     1040253   524287480+  83  Linux
[root@oracledb /]# mkfs.ext3 /dev/vdb1#格式化刚刚的那个分区,格式为ext3,注意名字已经变为vdb1了,不要打错了
mke2fs 1.41.12 (17-May-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
32768000 inodes, 131071870 blocks
6553593 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
4000 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
    102400000

Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: #回车一下,慢慢等
done

This filesystem will be automatically checked every 27 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.

[root@oracledb /]# mount /dev/vdb1 /u01#挂载
[root@oracledb ~]# df -h#查看一下,哎~又有了
Filesystem            Size  Used Avail Use% Mounted on
/dev/vda1              40G  2.9G   36G   8% /
tmpfs                 7.8G     0  7.8G   0% /dev/shm
/dev/vdb1             493G  4.5G  463G   1% /u01#就是我
[root@oracledb /]# mount
/dev/vda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/vdb1 on /u01 type ext3 (rw)#能看到这个分区,格式为ext3
设置开机启动自动挂载vi /etc/fstab
/dev/vdb1                               /home                   ext4    defaults        0  0

相关文章

  • Mac

    解决Mac挂载ntfs磁盘readonly 找到磁盘设备号 弹出磁盘 以读写权限重新挂载磁盘

  • 磁盘挂载

    一、查看磁盘挂载情况 二、查看所有磁盘 三、创建磁盘分区 四、格式化分区磁盘 五、挂载 六、卸载 七、查看挂载权限

  • 14-1高级文件系统管理之磁盘配额

    配置磁盘配额 一、开启磁盘配额功能 在/etc/fstab磁盘配额的挂载设备那行,挂载选项添加:分区挂载选项:us...

  • armbian挂载硬盘

    手动挂载 检测磁盘 建立目录 挂载 开机自动挂载 查看磁盘信息 记下UUID、TYPE 修改 /etc/fstab...

  • 在新买的磁盘如何挂载到我们的服务器上呢

    1.查看目前磁盘 2.格式化新磁盘 3.挂载磁盘需要先创建一个目录 4.挂载磁盘 5.为了避免重启机器时重新挂载,...

  • CenterOs

    磁盘挂载 fdisk -l 当前磁盘信息 mount /dev/xvde1 /mnt 挂载到/mnt df -...

  • ubuntu下挂载硬盘

    查看分区 可以根据上图提供的磁盘信息确定想挂载的磁盘,以及确定挂载的位置。 创建挂载目录 在挂载的时候报错:mou...

  • 亚马逊Amazon Linux 2 AMI磁盘挂载实践

    1、查看已挂载好的磁盘,命令:df -h 2、列出可用磁盘,命令:lsblk -l 3、找到为挂载的磁盘xvdb并...

  • 2019-08-01

    day24 操作系统磁盘管理章节 课程介绍部分 1.磁盘体系结构应用磁盘格式化操作磁盘挂载操作 - 如何自动挂载 ...

  • Linux分区

    1. 磁盘相关指令 怎么设置永久挂载? 编辑 /etc/fstab 文件mount -a 自动挂载 2. 磁盘情况...

网友评论

      本文标题:磁盘挂载

      本文链接:https://www.haomeiwen.com/subject/rsvujxtx.html