博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[草稿]挂载新硬盘
阅读量:5123 次
发布时间:2019-06-13

本文共 3566 字,大约阅读时间需要 11 分钟。

查看新硬盘&创建分区

xxx@xxx:/dev$ sudo fdisk -l[sudo] password for xxx: Disk /dev/sda: 85.9 GB, 85899345920 bytes255 heads, 63 sectors/track, 10443 cylinders, total 167772160 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x0006109e   Device Boot      Start         End      Blocks   Id  System/dev/sda1   *        2048   159385599    79691776   83  Linux/dev/sda2       159387646   167770111     4191233    5  Extended/dev/sda5       159387648   167770111     4191232   82  Linux swap / SolarisDisk /dev/sdb: 214.7 GB, 214748364800 bytes255 heads, 63 sectors/track, 26108 cylinders, total 419430400 sectorsUnits = sectors of 1 * 512 = 512 bytesSector size (logical/physical): 512 bytes / 512 bytesI/O size (minimum/optimal): 512 bytes / 512 bytesDisk identifier: 0x00000000Disk /dev/sdb doesn't contain a valid partition tablexxx@xxx:/dev$ sudo fdisk /dev/sdbDevice contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabelBuilding a new DOS disklabel with disk identifier 0xdc2cc610.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)Command (m for help): mCommand action   a   toggle a bootable flag   b   edit bsd disklabel   c   toggle the dos compatibility flag   d   delete a partition   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)Command (m for help): nPartition type:   p   primary (0 primary, 0 extended, 4 free)   e   extendedSelect (default p): pPartition number (1-4, default 1): 1First sector (2048-419430399, default 2048): Using default value 2048Last sector, +sectors or +size{K,M,G} (2048-419430399, default 419430399): Using default value 419430399Command (m for help): wThe partition table has been altered!Calling ioctl() to re-read partition table.Syncing disks.

 

格式化 & 挂载硬盘 & 开机自动挂载

For Ubuntu (14.04)

xxx@xxx:/$ df -T /dev/sda1Filesystem     Type 1K-blocks    Used Available Use% Mounted on/dev/sda1      ext4  78310344 5329308  68980064   8% /xxx@xxx:/$ sudo mkfs.ext4 /dev/sdb1mke2fs 1.42.9 (4-Feb-2014)Filesystem label=OS type: LinuxBlock size=4096 (log=2)Fragment size=4096 (log=2)Stride=0 blocks, Stripe width=0 blocks13107200 inodes, 52428544 blocks2621427 blocks (5.00%) reserved for the super userFirst data block=0Maximum filesystem blocks=42949672961600 block groups32768 blocks per group, 32768 fragments per group8192 inodes per groupSuperblock backups stored on blocks: 	32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 	4096000, 7962624, 11239424, 20480000, 23887872Allocating group tables: done                            Writing inode tables: done                            Creating journal (32768 blocks): doneWriting superblocks and filesystem accounting information: done     xxx@xxx:/$ sudo mkdir xhomexxx@xxx:/$ sudo mount /dev/sdb1 /xhomexxx@xxx:/$ sudo vim /etc/fstab # edit file fstab according to the file's original contents.xxx@xxx:/$ sudo mount -a  #check if the disk is mounted correctly.

 

转载于:https://www.cnblogs.com/chinshing/p/4043505.html

你可能感兴趣的文章
人物角色群体攻击判定(一)
查看>>
JavaWeb学习过程 之c3p0的使用
查看>>
MySql Delimiter
查看>>
一步步学习微软InfoPath2010和SP2010--第九章节--使用SharePoint用户配置文件Web service(2)--在事件注册表单上创建表单加载规则...
查看>>
使用客户端对象模型读取SharePoint列表数据
查看>>
POJ 1328 Radar Installation 贪心
查看>>
gulp插件gulp-ruby-sass和livereload插件
查看>>
单元测试原来是这样的呼
查看>>
java定时任务详解
查看>>
IOS之导航控制器与表视图
查看>>
MSYS2使用教程
查看>>
Hadoop 配置文件 & 启动方式
查看>>
2016年4月 之 《C程序设计语言》
查看>>
WCF配置报错 在 ServiceModel 客户端配置部分中,找不到名称 和协定
查看>>
SQL基础问题整理
查看>>
C++刷称号——2707: 素数与要素
查看>>
coco2dx c++ HTTP实现
查看>>
Hadoop 开源调度系统zeus(二)
查看>>
基于上一篇AS项目依赖库问题的优化解决方案
查看>>
Java——操作集合的工具类:Collections
查看>>