Linux 下挂载新硬盘的方法.docx_第1页
Linux 下挂载新硬盘的方法.docx_第2页
Linux 下挂载新硬盘的方法.docx_第3页
Linux 下挂载新硬盘的方法.docx_第4页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Linux 下挂载硬盘的 方法 装虚拟机时空间划小了,于是又加了5G的空间,折腾了半天,挂上去了。整理下弄个笔记,备用。1. 添加磁盘,查看磁盘状况rootdb1 /# fdisk -lDisk /dev/sda: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 151 1305 9277537+ 83 Linux/dev/sda2 1 150 1204843+ 82 Linux swapPartition table entries are not in disk orderDisk /dev/sdb: 5368 MB, 5368709120 bytes255 heads, 63 sectors/track, 652 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System从查询结果看出,多了一个/dev/sdb的盘2. 用fdisk 对/dev/sdb 进行分区rootdb1 /# fdisk /dev/sdbCommand (m for help): nCommand action e extended p primary partition (1-4)pPartition number (1-4): 1First cylinder (1-652, default 1):Using default value 1Last cylinder or +size or +sizeM or +sizeK (1-652, default 652):Using default value 652Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.再次查看分区情况,多出来一个/dev/sdb1 的区,这个1是我们在前面指定的,如果我们指定2,就变成 sdb2了。rootdb1 /# fdisk -lDisk /dev/sda: 10.7 GB, 10737418240 bytes255 heads, 63 sectors/track, 1305 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sda1 * 151 1305 9277537+ 83 Linux/dev/sda2 1 150 1204843+ 82 Linux swapPartition table entries are not in disk orderDisk /dev/sdb: 5368 MB, 5368709120 bytes255 heads, 63 sectors/track, 652 cylindersUnits = cylinders of 16065 * 512 = 8225280 bytes Device Boot Start End Blocks Id System/dev/sdb1 1 652 5237158+ 83 Linuxrootdb1 /#如果创建完之后,/proc/partitions 查看不到对应的分区,使用parprobe 命令刷新一下就可以了:rootweb1 # cat /proc/partitionsmajor minor #blocks name 8 0 175825944 sda 8 1 1020096 sda1 8 2 30716280 sda2 8 3 8193150 sda3rootweb1 # partprobe /dev/sdarootweb1 # cat /proc/partitionsmajor minor #blocks name 8 0 175825944 sda 8 1 1020096 sda1 8 2 30716280 sda2 8 3 8193150 sda3 8 4 135893835 sda4rootweb1 #3. 格式化 /dev/sdb1 分区rootdb1 /# mkfs -t ext3 /dev/sdb1mke2fs 1.35 (28-Feb-2004)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)655360 inodes, 1309289 blocks65464 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=134217728040 block groups32768 blocks per group, 32768 fragments per group16384 inodes per groupSuperblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736Writing inode tables: doneCreating journal (8192 blocks): doneWriting superblocks and filesystem accounting information: doneThis filesystem will be automatically checked every 30 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.4. 创建目录 并将 /dev/sdb1 挂在到该目录下rootdb1 /# lsbackup dev initrd media opt sbin sys usrbin etc lib misc proc selinux tftpboot varboot home lost+found mnt root srv tmprootdb1 /# mkdir /u01rootdb1 /# lsbackup dev initrd media opt sbin sys u01bin etc lib misc proc selinux tftpboot usrboot home lost+found mnt root srv tmp varrootdb1 /# mount /dev/sdb1 /u015. 验证挂载是否成功rootdb1 /# df -kFilesystem 1K-blocks Used Available Use% Mounted on/dev/sda1 9131772 7066884 1601012 82% /none 454256 0 454256 0% /dev/shm/dev/sdb1 5154852 43040 4849956 1% /backup6. 设置开机自动挂载rootdb1 /# vi /etc/fstab# This file is edited by fstab-sync - see man fstab-sync for detailsLABEL=/ / ext3 defaults 1 1none /dev/pts devpts gid=5,mode=620 0 0none /dev/shm tmpfs defaults 0 0none /proc proc defaults 0 0none /sys sysfs defaults 0 0LABEL=SWAP-s

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论