Linux下磁盘分区、挂载、卸载操作记录

Linux下磁盘分区、挂载、卸载操作记录.

操作环境:CentOS release 6.5 (Final)

Last login: Wed Oct 26 17:25:27 2016 from 118.230.194.76
[[email protected] ~]#
[[email protected] ~]# fdisk -l

Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 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: 0x00058962

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          63      506016   83  Linux
/dev/sda2              64       65271   523774976   8e  Linux LVM

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk identifier: 0x8406cab6

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/mapper/vg_centos-lv_root: 483.2 GB, 483183820800 bytes
255 heads, 63 sectors/track, 58743 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_home: 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: 0x00000000

[[email protected] ~]# fdisk /dev/sdb

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): p

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk identifier: 0x8406cab6

   Device Boot      Start         End      Blocks   Id  System

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 1
First cylinder (1-65270, default 1): 1
Last cylinder, +cylinders or +size{K,M,G} (1-65270, default 65270):
Using default value 65270

Command (m for help): p

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk identifier: 0x8406cab6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       65270   524281243+  83  Linux
Partition 1 does not start on physical sector boundary.

Command (m for help): n
Command action
   e   extended
   p   primary partition (1-4)
p
Partition number (1-4): 2
No free sectors available

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

Calling ioctl() to re-read partition table.
Syncing disks.
[[email protected] ~]# fdisk -l

Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 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: 0x00058962

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          63      506016   83  Linux
/dev/sda2              64       65271   523774976   8e  Linux LVM

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk identifier: 0x8406cab6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       65270   524281243+  83  Linux
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/vg_centos-lv_root: 483.2 GB, 483183820800 bytes
255 heads, 63 sectors/track, 58743 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_home: 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: 0x00000000

[[email protected] ~]# mkfs.ext3 /dev/sdb1
mke2fs 1.41.12 (17-May-2010)
/dev/sdb1 alignment is offset by 33280 bytes.
This may result in very poor performance, (re)-partitioning suggested.
文件系统标签=
操作系统:Linux
块大小=4096 (log=2)
分块大小=4096 (log=2)
Stride=16 blocks, Stripe width=0 blocks
32768000 inodes, 131070310 blocks
6553515 blocks (5.00%) reserved for the super user
第一个数据块=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

正在写入inode表: 完成
Creating journal (32768 blocks): 完成
Writing superblocks and filesystem accounting information:
完成

This filesystem will be automatically checked every 26 mounts or
180 days, whichever comes first.  Use tune2fs -c or -i to override.
[[email protected] ~]#
[[email protected] ~]# fdisk -l

Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 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: 0x00058962

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          63      506016   83  Linux
/dev/sda2              64       65271   523774976   8e  Linux LVM

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk identifier: 0x8406cab6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       65270   524281243+  83  Linux
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/vg_centos-lv_root: 483.2 GB, 483183820800 bytes
255 heads, 63 sectors/track, 58743 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_home: 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: 0x00000000

[[email protected] ~]# pwd
/root
[[email protected] ~]# cd /opt
[[email protected] opt]# mkdir sdb1
[[email protected] opt]# mount /dev/sdb1 /opt/sdb1
[[email protected] opt]# mount
/dev/mapper/vg_centos-lv_root 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,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_centos-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sdb1 on /opt/sdb1 type ext3 (rw)
[[email protected] opt]#
[[email protected] opt]# cd sdb1/
[[email protected] sdb1]# ls
lost+found
[[email protected] sdb1]# ll
总用量 16
drwx------. 2 root root 16384 10月 26 17:55 lost+found
[[email protected] sdb1]#
[[email protected] sdb1]#
[[email protected] sdb1]# cd ..
[[email protected] opt]#
[[email protected] opt]# umount /opt/sdb1/
[[email protected] opt]#
[[email protected] opt]# mount
/dev/mapper/vg_centos-lv_root 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,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/mapper/vg_centos-lv_home on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
[[email protected] opt]#
[[email protected] opt]#
[[email protected] opt]#
[[email protected] opt]# fdisk -l

Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 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: 0x00058962

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          63      506016   83  Linux
/dev/sda2              64       65271   523774976   8e  Linux LVM

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk identifier: 0x8406cab6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       65270   524281243+  83  Linux
Partition 1 does not start on physical sector boundary.

Disk /dev/mapper/vg_centos-lv_root: 483.2 GB, 483183820800 bytes
255 heads, 63 sectors/track, 58743 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_home: 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: 0x00000000

[[email protected] opt]# fdisk /dev/sdb

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): p

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk identifier: 0x8406cab6

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1       65270   524281243+  83  Linux
Partition 1 does not start on physical sector boundary.

Command (m for help): d
Selected partition 1

Command (m for help): 1
1: unknown command
Command 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): p

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk identifier: 0x8406cab6

   Device Boot      Start         End      Blocks   Id  System

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

Calling ioctl() to re-read partition table.
Syncing disks.
[[email protected] opt]# fdisk -l

Disk /dev/sda: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 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: 0x00058962

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1          63      506016   83  Linux
/dev/sda2              64       65271   523774976   8e  Linux LVM

Disk /dev/sdb: 536.9 GB, 536870912000 bytes
255 heads, 63 sectors/track, 65270 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 65536 bytes / 65536 bytes
Disk identifier: 0x8406cab6

   Device Boot      Start         End      Blocks   Id  System

Disk /dev/mapper/vg_centos-lv_root: 483.2 GB, 483183820800 bytes
255 heads, 63 sectors/track, 58743 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_swap: 4160 MB, 4160749568 bytes
255 heads, 63 sectors/track, 505 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: 0x00000000

Disk /dev/mapper/vg_centos-lv_home: 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: 0x00000000

[[email protected] opt]#
时间: 2024-12-25 01:08:56

Linux下磁盘分区、挂载、卸载操作记录的相关文章

Linux下磁盘分区挂载

一般你去买vps都会看到介绍说硬盘多少G  比如 80G 但是你进入系统df -h的时候发现怎么只有10G呢, 其实这10G是用来装系统的和一些常用服务软件的  不是给你放网站数据的 那50G硬盘在哪里,就像你在电脑里面新加一块硬盘,你不进行分区和挂载也是看不到的 所以我们首先看看电脑里面的硬盘分区情况 看得出只有sda这块硬盘是分区挂载好了的  而sdb这块硬盘还没有分区 所以我们df肯定看不到的  现在我们就来把这块硬盘分区挂上去 首先是分区: 下面以分扩展分区来讲(分主分区比分扩展分区少一

linux下磁盘的挂载

linux下磁盘的挂载与卸载 Linux下每个文件系统都有独立的inode,block,super block等信息,这个文件系统要挂载到目录树才可以使用,将文件系统与目录树结合的操作称为挂载,反之则为卸载. 也就是说,挂载点一定是目录,而目录是进入磁盘分区(也就是文件系统)的入口. 挂载时有三点需要注意: 1.单一文件系统不应该重复被挂载到不同的挂载点(目录)中:2.单一目录不应该重复挂载多个文件系统#这两点可以类比windows磁盘与盘符的关系,一一对应.3.作为挂载点的目录理论上应该是空目

xshell远程连接服务器和Linux下磁盘分区方案

一,设置xshell进入xshell,选择文件,打开,新建.改会话名称,并改主意主机ip:二,远程连接服务器故障排查1,ip地址,也就是服务器的位置,地址:1)公网ip:指所有人都可以访问的ip,但是数量有限且大部分在美国:2)内网,也就是局域网,私网,是指在当前环境可以用的ip192.168.xx.oo 172.16.oo.xx 10.0.0.xx 192.168.21.xx10.0.0.xx 10.0.0.200:2,端口号:端口号是用来区分不同服务的(远程连接服务------->sshd-

Linux下磁盘的挂载与卸载

磁盘的分区和格式化完成后,我们还是不能马上使用,还差一步:挂载 在windows os 下用户是看不到这个过程的,因为是自动挂载上的:而在linux下,是需要我们手动去挂载到一个目录下. 比如将/dev/sdb5挂载到/mnt目录下: # mount /dev/sdb5 /mnt 如果把分区挂载到一个已经存在文件的目录下,则会完全覆盖原有的文件,所以必须将分区挂载到空的目录下: # mount /dev/sdb5 /home/ 但如果不小心真的覆盖了,别担心,原有的文件并没有被删除,只需要卸载现

Linux下磁盘分区、挂载

具体步骤如下: 1.查看是否已经分配 [[email protected] home]# fdisk -l 磁盘 /dev/sda:64.4 GB, 64424509440 字节,125829120 个扇区 Units = 扇区 of 1 * 512 = 512 bytes 扇区大小(逻辑/物理):512 字节 / 512 字节 I/O 大小(最小/最佳):512 字节 / 512 字节 磁盘标签类型:dos 磁盘标识符:0x000a47ad 设备 Boot Start End Blocks I

linux下磁盘分区、格式化、挂载

各种设备在linux下的文件名 实验: 1) 开启Linux系统前添加一块大小为15G的SCSI硬盘2) 开启系统,右击桌面,打开终端3) 为新加的硬盘分区,一个主分区大小为5G,剩余空间给扩展分区,在扩展分区上划分1个逻辑分区,大小为5G4) 格式化主分区为ext3系统5) 将逻辑分区设置为交换分区6) 启用上一步的交换分区7) 查看交换分区的状态 查看linux下设备信息 [[email protected] ~]# ls /dev/sd*/dev/sda /dev/sda1 /dev/sd

Linux下IP SAN共享存储操作记录

一.简单介绍SAN,即存储区域网络(storage area network and SAN protocols),它是一种高速网络实现计算机与存储系统之间的数据传输.常见的分类是FC-SAN和IP-SAN两种.FC-SAN通过光纤通道协议转发scsi协议:IP-SAN通过TCP协议转发scsi协议,也就是IP 地址.存储设备是指一台或多台用以存储计算机数据的磁盘设备,通常指磁盘阵列,主要厂商EMC.日立等. iSCSI(internet SCSI)技术由IBM公司研究开发,是一个供硬件设备使用

linux下磁盘分区详解

给新硬盘上建立分区时都要遵循以下的顺序:建立主分区→建立扩展分区→建立逻辑分区→激活主分区→格式化所有分区. 一个硬盘的主分区也就是包含操作系统启动所必需的文件和数据的硬盘分区,要在硬盘上安装操作系统,则该硬盘必须得有一个主分区.         扩展分区也就是除主分区外的分区,但它不能直接使用,必须再将它划分为若干个逻辑分区才行.逻辑分区也就是我们平常在操作系统中所看到的D.E.F等盘. 分区从实质上说就是对硬盘的一种格式化.当我们创建分区时,就已经设置好了硬盘的各项物理参数,指定了BIOS系

linux的磁盘分区, 挂载命令

|--分区基础知识 说明: |--1.linux无论有几个分区,分给那一目录使用, 只有一个根目录,一个独立且唯一的文件结构 linux中每个分区都是用来组成整个文件系统的一部分 |--2.linux采用一种叫"载入"的处理方式,它的整个文件系统 中包含一个整套的文件和目录,且将一个分区和一个目录 联系起来,这时要载入的一个分区将使它的存储空间 在一个目录下获得|--分区的方式 |--1.mbr分区 |--最多支持四个主分区 |--系统只能安装在主分区 |--扩展分区要占一个主分区 |