首页 > 系统服务 > 详细

Linux分区和挂载硬盘

时间:2014-07-09 16:41:52      阅读:441      评论:0      收藏:0      [点我收藏+]

分区:

[root@code-svn ~]# fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. Its 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
First cylinder (1-5221, default 1): 
Using default value 1
Last cylinder, +cylinders or +size{K,M,G} (1-5221, default 5221): 
Using default value 5221

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.

格式化:

[root@code-svn ~]# mkfs -t ext3 /dev/sdb1

查看硬盘:

[root@code-svn ~]# fdisk -l

挂载:

[root@code-svn ~]# mkdir /disk01
[root@code-svn ~]# mount /dev/sdb1 /disk01/

开机挂载:

root@code-svn ~]# vi /etc/fstab 
#
# /etc/fstab
# Created by anaconda on Tue Jul  8 17:41:53 2014
#
# Accessible filesystems, by reference, are maintained under /dev/disk
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_codesvn-lv_root /                       ext4    defaults        1 1
UUID=40b1eb12-d29b-4023-a878-a36d39aa68ba /boot                   ext4    defaults        1 2
/dev/mapper/vg_codesvn-lv_swap swap                    swap    defaults        0 0
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/sdb1               /disk01                 ext3    defaults        0 0
~

 

 

 

Linux分区和挂载硬盘,布布扣,bubuko.com

Linux分区和挂载硬盘

原文:http://www.cnblogs.com/ShepherdIsland/p/3832027.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!