Linux下添加新磁盘并挂载到指定目录的方法_第1页
Linux下添加新磁盘并挂载到指定目录的方法_第2页
Linux下添加新磁盘并挂载到指定目录的方法_第3页
Linux下添加新磁盘并挂载到指定目录的方法_第4页
Linux下添加新磁盘并挂载到指定目录的方法_第5页
已阅读5页,还剩2页未读 继续免费阅读

下载本文档

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

文档简介

1、在 Linux 系统中添加硬盘,并挂载到已有的目录以如下为例:环境 说明:Linux RedHat4 Updata4 ,加载 6块 SAS硬盘,做一个 Raid5.挂载到 /home/trsmanager 目录,要求保证目录中原有数据完好已经建好的 TRS 全文检索,放在 /home/trsmanager 中,想要将扩展的硬盘空间挂载到 trsmanager 文件夹上,并保证全文检索正常。方法:将添加上的硬盘使用 Linux 的 fdisk 制作一个文件系统,挂载到已有目录下。rootTRS01 home# lslost+found trsmanagerrootTRS01 home# lslo

2、st+found trsmanagerrootTRS01 home# cd t*rootTRS01 trsmanager# lstrshomerootTRS01 trsmanager# cd .rootTRS01 home# tar cvf trsmanager.tar trsmanager #将本来的文件夹 trsmanager打包保存。(后续将原来的 trsmanager 清空,挂载建立好的文件系统,然后将打包的东西解 压到这个目录中,还原 trsmanager 文件夹中的文件) 。rootTRS01 home# ls #ls 查看并确定打包完成lost+found trsmanager

3、trsmanager.tarrootTRS01 home# rm -rf trsmanager # 删除 trsmanager 文件夹rootTRS01 home# lslost+found trsmanager.tarrootTRS01 home#rootTRS01 home#rootTRS01 /# fdisk - l # 查看 raid 后的硬盘Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes255 heads, 32 sectors/track, 35132 cylindersUnits = cylinders of 8160 * 5

4、12 = 4177920 bytesDevice Boot Start/dev/cciss/c0d0p1 */dev/cciss/c0d0p2/dev/cciss/c0d0p3/dev/cciss/c0d0p4/dev/cciss/c0d0p5/dev/cciss/c0d0p6/dev/cciss/c0d0p712571048544 83 Linux258539720971200 83 Linux5398105372097120083Linux10538351321003476005Extended10538156772097118483Linux15678208172097118483Lin

5、ux2081822873838846483LinuxEnd Blocks Id System/dev/cciss/c0d0p8/dev/cciss/c0d0p922874249298388464 82 Linux swap2493035132 41628224 83 LinuxDisk /dev/cciss/c0d1: 733.9 GB, 733910294528 bytes255 heads, 32 sectors/track, 175664 cyli ndersraid后的硬盘Units = cyli nders of 8160 * 512 = 4177920 bytes #Device

6、Boot Start End Blocks Id SystemraidrootTRS01 /# fdisk /dev/cciss/c0d1 # 此处的 /dev/cciss/c0d1即为上面查看的后的Disk名称The nu mber of cyli nders for this disk is set to 175664.There is nothing wrong with that, but this is larger tha n 1024,and could in certa in setups cause problems with:1) software that runs at

7、 boot time (e.g., old versions of LILO)2) booti ng and partiti oning software from other OSs(e.g., DOS FDISK, OS/2 FDISK)Comma nd (m for help): m#此处输入 m,查看可使用的命令Comma nd actiona toggle a bootable flagb edit bsd disklabelc toggle the dos compatibility flagd delete a partiti onl list known partiti on

8、typesm print this menun add a new partiti ono create a new empty DOS partitio n tablep print the partition tableq quit without savi ng cha ngess create a new empty Sun disklabelt cha nge a partiti ons system idu cha nge display/e ntry un itsv verify the partiti on tablew write table to disk and exit

9、x extra function ality (experts only)Comma nd (m for help): n #输入n,新建一个磁盘分区Comma nd actione exte ndedp primary partiti on (1-4)pPartition number (1-4): 1#输入1,即为主磁盘分区First cyli nder (1-175664, default 1): 1 #输入 1回车Last cyli nder or +size or +sizeM or +sizeK (1-175664, default 175664): #Using default

10、value 175664Comma nd (m for help): p # print the partiti on tableDisk /dev/cciss/c0d1: 733.9 GB, 733910294528 bytes255 heads, 32 sectors/track, 175664 cyli ndersUnits = cyli nders of 8160 * 512 = 4177920 bytesDevice Boot Start/dev/cciss/c0d1p11End Blocks Id System175664 716709104 83 LinuxComma nd (m

11、 for help): w #写保存并退出The partiti on table has bee n altered!Calli ng ioctl() to re-read partiti on table.Syncing disks.rootTRS01 /# fdisk - l # 查看是否已建好逻辑磁盘Disk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes255 heads, 32 sectors/track, 35132 cyli ndersUnits = cyli nders of 8160 * 512 = 4177920 bytes/d

12、ev/cciss/c0d0p1 *12571048544 83 Linux/dev/cciss/c0d0p2258539720971200 83 Linux/dev/cciss/c0d0p35398105372097120083Li nux/dev/cciss/c0d0p410538351321003476005Exte nded/dev/cciss/c0d0p510538156772097118483Linux/dev/cciss/c0d0p615678208172097118483Linux/dev/cciss/c0d0p72081822873838846483Li nux/dev/cci

13、ss/c0d0p82287424929838846482Linux swap/dev/cciss/c0d0p924930351324162822483LinuxDevice Boot StartEnd Blocks Id SystemDisk /dev/cciss/c0d1: 733.9 GB, 733910294528 bytes255 heads, 32 sectors/track, 175664 cyli ndersUnits = cyli nders of 8160 * 512 = 4177920 bytesDevice Boot Start End Blocks Id System

14、/dev/cciss/c0d1p11175664 716709104 83 Lin ux #建立完成rootTRS01 /#rootTRS01 home# Islost+fo und trsma nager.tartrsma nagerrootTRS01 home# mkdir trsmanager # 在 /home 目录下新建一个文件夹rootTRS01 home# lslost+fo und trsma nager trsma nager.tarrootTRS01 home# fdisk -lDisk /dev/cciss/cOdO: 146.7 GB, 146778685440 byt

15、es255 heads, 32 sectors/track, 35132 cyli ndersUnits = cyli nders of 8160 * 512 = 4177920 bytes/dev/cciss/c0d0p1 *12571048544 83 Linux/dev/cciss/c0d0p2258539720971200 83 Linux/dev/cciss/c0d0p35398105372097120083Li nux/dev/cciss/c0d0p410538351321003476005Exte nded/dev/cciss/c0d0p510538156772097118483

16、Linux/dev/cciss/c0d0p615678208172097118483Linux/dev/cciss/c0d0p72081822873838846483Li nux/dev/cciss/c0d0p82287424929838846482Linux swap/dev/cciss/c0d0p924930351324162822483LinuxDevice Boot StartEnd Blocks Id SystemDisk /dev/cciss/c0d1: 733.9 GB, 733910294528 bytes255 heads, 32 sectors/track, 175664

17、cyli ndersUnits = cyli nders of 8160 * 512 = 4177920 bytesDevice Boot Start End Blocks Id System /dev/cciss/c0d1p11175664 716709104 83 LinuxrootTRS01 home# mkfs.ext3 /dev/cciss/c0d1p1 #建立文件系统mke2fs 1.35 (28-Feb-2004)Filesystem label=OS type: Li nuxBlock size=4096 (log=2)Fragme nt size=4096 (log=2)89

18、604096 ino des, 179177276 blocks8958863 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=42949672965469 block groups32768 blocks per group, 32768 fragme nts per group16384 ino des per groupSuperblock backups stored on blocks:32768, 98304, 163840, 229376, 294912,

19、819200, 884736, 1605632, 2654208,4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 102400000Writing inode tables: doneCreating journal (8192 blocks): doneWriting superblocks and filesystem accounting information: done#以上 done 会自动完成This filesystem will be automatically checked every

20、 26 mounts or180 days, whichever comes first. Use tune2fs -c or -i to override.rootTRS01 /# fdisk -lDisk /dev/cciss/c0d0: 146.7 GB, 146778685440 bytes255 heads, 32 sectors/track, 35132 cylindersUnits = cylinders of 8160 * 512 = 4177920 bytesDevice BootStartEnd Blocks Id System/dev/cciss/c0d0p1 *1257

21、 1048544 83Linux/dev/cciss/c0d0p2258539720971200 83 Linux/dev/cciss/c0d0p35398105372097120083Linux/dev/cciss/c0d0p410538351321003476005Extended/dev/cciss/c0d0p510538156772097118483Linux/dev/cciss/c0d0p615678208172097118483Linux/dev/cciss/c0d0p72081822873838846483Linux/dev/cciss/c0d0p82287424929838846482Linux swap/dev/cciss/c0d0p924930351324162822483LinuxDisk /dev/cciss/c0d1: 733.9 GB, 733910294528 bytes255 heads, 32 sectors/track, 175664 cylindersUnits = cylinders of 8160 * 512 =

温馨提示

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

评论

0/150

提交评论