- 浏览: 150010 次
- 性别:
- 来自: 广州
文章分类
最新评论
-
qiuxue126com:
学习了 !
nodejs http 发送请求 -
ZZX19880809:
一笑而过就好了,反正我不赶铁路
铁道部那坑爹的系统。
##由于程序需要读取信息,会出现PCI(sysfs)读取中
root@ubuntu:~# sudo lshw -C disk
*-disk
description: SCSI Disk
physical id: 0.0.0
bus info: scsi@0:0.0.0
logical name: /dev/sda
size: 279GiB (300GB)
capabilities: partitioned partitioned:dos
configuration: signature=000e042e
*-disk
description: ATA Disk
product: INTEL SSDSC2CW06
physical id: 0.0.0
bus info: scsi@2:0.0.0
logical name: /dev/sdb
version: 400i
serial: EKCV321500DF060AGN
size: 55GiB (60GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 signature=000d4dbd
root@ubuntu:~# fdisk -l
Disk /dev/sdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d4dbd
Device Boot Start End Blocks Id System
/dev/sdb1 39106560 117229567 39061504 83 Linux
/dev/sdb2 2048 15624191 7811072 82 Linux swap / Solaris
/dev/sdb3 * 15624192 16015359 195584 83 Linux
/dev/sdb4 16015360 39106559 11545600 83 Linux
Partition table entries are not in disk order
Disk /dev/sda: 300.0 GB, 300000000000 bytes
255 heads, 63 sectors/track, 36472 cylinders, total 585937500 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e042e
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 552439807 276218880 83 Linux
/dev/sda2 552441854 585936895 16747521 5 Extended
/dev/sda5 552441856 585936895 16747520 82 Linux swap / Solaris
fdisk: unable to read /dev/mapper/cryptswap1: Inappropriate ioctl for device
root@ubuntu:~# fdisk /dev/sda
Command (m for help): n
Partition type:
p primary (1 primary, 1 extended, 2 free)
l logical (numbered from 5)
Select (default p): p
Partition number (1-4, default 3): 3
First sector (552439808-585937499, default 552439808):
Using default value 552439808
Last sector, +sectors or +size{K,M,G} (552439808-552441853, default 552441853):
Using default value 552441853
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
##*******************************************************************************##
## error 16: Device or resource busy.
## 由于该磁盘已经分区,则再进行分区,则会提示以下错误.
## root@ubuntu:~# fdisk -l
##
## Disk /dev/sda: 300.0 GB, 300000000000 bytes
## 255 heads, 63 sectors/track, 36472 cylinders, total 585937500 sectors
## Units = sectors of 1 * 512 = 512 bytes
## Sector size (logical/physical): 512 bytes / 512 bytes
## I/O size (minimum/optimal): 512 bytes / 512 bytes
## Disk identifier: 0x000e042e
## Device Boot Start End Blocks Id System
## /dev/sda1 * 2048 552439807 276218880 83 Linux
## /dev/sda2 552441854 585936895 16747521 5 Extended
## /dev/sda5 552441856 585936895 16747520 82 Linux swap / Solaris
## fdisk: unable to read /dev/mapper/cryptswap1: Inappropriate ioctl for device
##********************************************************************************##
##直接mount
root@ubuntu:~# mount /dev/sda1 /data/
##验证一下是否挂载成功
root@ubuntu:~# df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdb1 ext4 40G 1.1G 37G 3% /
udev devtmpfs 8.4G 4.1k 8.4G 1% /dev
tmpfs tmpfs 3.4G 283k 3.4G 1% /run
none tmpfs 5.3M 0 5.3M 0% /run/lock
none tmpfs 8.5G 4.1k 8.5G 1% /run/shm
/dev/sdb3 ext4 190M 33M 147M 19% /boot
/dev/sdb4 ext4 12G 30M 11G 1% /home
/dev/sda1 ext4 279G 62M 265G 1% /data
## ls /data 发现/data遗留了太多的之前系统的数据,所以需要进该分区进行格式化
##发现原来挂载的分区是不能被格式化的,所以需要先对其对卸载.
root@ubuntu:/data# mkfs -t ext4 /dev/sda1
mke2fs 1.42 (29-Nov-2011)
/dev/sda1 is mounted; will not make a filesystem here!
##卸载的时候发现,原来有人正在使用该分区,不能卸载。
root@ubuntu:/data# umount /data
umount: /data: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
##查看一下是谁使用了该分区。
root@ubuntu:/data# fuser -m -v /data/
USER PID ACCESS COMMAND
/data: root kernel mount /data
root 8834 ..c.. bash
yuxin 9111 ..c.. bash
##Kill使用该分区的用户,把root也直接kill
root@ubuntu:/data# kill -9 9111
root@ubuntu:/data# kill -9 8834
##卸载成功
root@ubuntu:/data# umount /data
root@ubuntu:/data#
##格式化该分区,成功.
root@ubuntu:~# mkfs -t ext4 /dev/sda1
mke2fs 1.42 (29-Nov-2011)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
17268736 inodes, 69054720 blocks
3452736 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
2108 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
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
##将其设置为开机自动挂载
##在最后一行加上
###################################################
#
# /dev/sda1 /data ext4 defaults 0 0
#
###################################################
root@ubuntu:/data# more /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=1dfe21b6-f0ec-41dd-9022-4b89b9db4e99 / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda3 during installation
UUID=58b86c68-3d15-43d5-9c38-9be2624352db /boot ext4 defaults 0 2
# /home was on /dev/sda4 during installation
UUID=4319d38f-dc57-4c4a-a9cb-7bdc678ba9d4 /home ext4 defaults 0 2
# swap was on /dev/sda2 during installation
#UUID=0875c384-60c7-410f-b7d4-8a994494cc1e none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
/dev/sda1 /data ext4 defaults 0 0
辅助资料:
http://wiki.ubuntu.org.cn/%E5%AE%89%E8%A3%85%E6%96%B0%E7%A1%AC%E7%9B%98
http://blog.csdn.net/tianlesoftware/article/details/5642883
root@ubuntu:~# sudo lshw -C disk
*-disk
description: SCSI Disk
physical id: 0.0.0
bus info: scsi@0:0.0.0
logical name: /dev/sda
size: 279GiB (300GB)
capabilities: partitioned partitioned:dos
configuration: signature=000e042e
*-disk
description: ATA Disk
product: INTEL SSDSC2CW06
physical id: 0.0.0
bus info: scsi@2:0.0.0
logical name: /dev/sdb
version: 400i
serial: EKCV321500DF060AGN
size: 55GiB (60GB)
capabilities: partitioned partitioned:dos
configuration: ansiversion=5 signature=000d4dbd
root@ubuntu:~# fdisk -l
Disk /dev/sdb: 60.0 GB, 60022480896 bytes
255 heads, 63 sectors/track, 7297 cylinders, total 117231408 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000d4dbd
Device Boot Start End Blocks Id System
/dev/sdb1 39106560 117229567 39061504 83 Linux
/dev/sdb2 2048 15624191 7811072 82 Linux swap / Solaris
/dev/sdb3 * 15624192 16015359 195584 83 Linux
/dev/sdb4 16015360 39106559 11545600 83 Linux
Partition table entries are not in disk order
Disk /dev/sda: 300.0 GB, 300000000000 bytes
255 heads, 63 sectors/track, 36472 cylinders, total 585937500 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000e042e
Device Boot Start End Blocks Id System
/dev/sda1 * 2048 552439807 276218880 83 Linux
/dev/sda2 552441854 585936895 16747521 5 Extended
/dev/sda5 552441856 585936895 16747520 82 Linux swap / Solaris
fdisk: unable to read /dev/mapper/cryptswap1: Inappropriate ioctl for device
root@ubuntu:~# fdisk /dev/sda
Command (m for help): n
Partition type:
p primary (1 primary, 1 extended, 2 free)
l logical (numbered from 5)
Select (default p): p
Partition number (1-4, default 3): 3
First sector (552439808-585937499, default 552439808):
Using default value 552439808
Last sector, +sectors or +size{K,M,G} (552439808-552441853, default 552441853):
Using default value 552441853
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
##*******************************************************************************##
## error 16: Device or resource busy.
## 由于该磁盘已经分区,则再进行分区,则会提示以下错误.
## root@ubuntu:~# fdisk -l
##
## Disk /dev/sda: 300.0 GB, 300000000000 bytes
## 255 heads, 63 sectors/track, 36472 cylinders, total 585937500 sectors
## Units = sectors of 1 * 512 = 512 bytes
## Sector size (logical/physical): 512 bytes / 512 bytes
## I/O size (minimum/optimal): 512 bytes / 512 bytes
## Disk identifier: 0x000e042e
## Device Boot Start End Blocks Id System
## /dev/sda1 * 2048 552439807 276218880 83 Linux
## /dev/sda2 552441854 585936895 16747521 5 Extended
## /dev/sda5 552441856 585936895 16747520 82 Linux swap / Solaris
## fdisk: unable to read /dev/mapper/cryptswap1: Inappropriate ioctl for device
##********************************************************************************##
##直接mount
root@ubuntu:~# mount /dev/sda1 /data/
##验证一下是否挂载成功
root@ubuntu:~# df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/sdb1 ext4 40G 1.1G 37G 3% /
udev devtmpfs 8.4G 4.1k 8.4G 1% /dev
tmpfs tmpfs 3.4G 283k 3.4G 1% /run
none tmpfs 5.3M 0 5.3M 0% /run/lock
none tmpfs 8.5G 4.1k 8.5G 1% /run/shm
/dev/sdb3 ext4 190M 33M 147M 19% /boot
/dev/sdb4 ext4 12G 30M 11G 1% /home
/dev/sda1 ext4 279G 62M 265G 1% /data
## ls /data 发现/data遗留了太多的之前系统的数据,所以需要进该分区进行格式化
##发现原来挂载的分区是不能被格式化的,所以需要先对其对卸载.
root@ubuntu:/data# mkfs -t ext4 /dev/sda1
mke2fs 1.42 (29-Nov-2011)
/dev/sda1 is mounted; will not make a filesystem here!
##卸载的时候发现,原来有人正在使用该分区,不能卸载。
root@ubuntu:/data# umount /data
umount: /data: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
##查看一下是谁使用了该分区。
root@ubuntu:/data# fuser -m -v /data/
USER PID ACCESS COMMAND
/data: root kernel mount /data
root 8834 ..c.. bash
yuxin 9111 ..c.. bash
##Kill使用该分区的用户,把root也直接kill
root@ubuntu:/data# kill -9 9111
root@ubuntu:/data# kill -9 8834
##卸载成功
root@ubuntu:/data# umount /data
root@ubuntu:/data#
##格式化该分区,成功.
root@ubuntu:~# mkfs -t ext4 /dev/sda1
mke2fs 1.42 (29-Nov-2011)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
17268736 inodes, 69054720 blocks
3452736 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=4294967296
2108 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
Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
##将其设置为开机自动挂载
##在最后一行加上
###################################################
#
# /dev/sda1 /data ext4 defaults 0 0
#
###################################################
root@ubuntu:/data# more /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=1dfe21b6-f0ec-41dd-9022-4b89b9db4e99 / ext4 errors=remount-ro 0 1
# /boot was on /dev/sda3 during installation
UUID=58b86c68-3d15-43d5-9c38-9be2624352db /boot ext4 defaults 0 2
# /home was on /dev/sda4 during installation
UUID=4319d38f-dc57-4c4a-a9cb-7bdc678ba9d4 /home ext4 defaults 0 2
# swap was on /dev/sda2 during installation
#UUID=0875c384-60c7-410f-b7d4-8a994494cc1e none swap sw 0 0
/dev/mapper/cryptswap1 none swap sw 0 0
/dev/sda1 /data ext4 defaults 0 0
辅助资料:
http://wiki.ubuntu.org.cn/%E5%AE%89%E8%A3%85%E6%96%B0%E7%A1%AC%E7%9B%98
http://blog.csdn.net/tianlesoftware/article/details/5642883
发表评论
-
1232112312
2015-03-12 13:42 0静态库,动态库用UNIX 的术语来说,或者叫做归档文件(arc ... -
linux 新增用户及增加该用户sudo权限
2014-04-26 09:39 1616增加新用户,使用adduser命令: root@AY1309 ... -
linux netstat命令
2014-04-26 09:33 598netstat命令 netstat -n CLOSED ... -
Linux 查看版本
2014-01-03 22:48 610$ > cat /etc/issue Ubuntu 12 ... -
crontab配置过程
2014-01-02 16:49 700root@AY130925102139735305Z:/dat ... -
rsync详细配置过程
2014-01-02 13:33 1427Rsync配置: 服务端配置: root@ubuntu:~ ... -
ulimit 设置
2014-01-01 22:27 978最近NodeJs项目经常挂起,后台在日志发现,有一个Error ... -
netstat 命令
2014-01-01 22:13 678Netstat的一些常用选项: netstat -a——显示 ... -
ubuntu 更改时区 tzselect
2013-12-12 23:13 1452Ubuntu 服务器 更改时区: tzselect 命令使用 ... -
linux open-ssh安装及重启
2013-11-21 23:24 7341、安装linux 服务端 sudo apt-get i ... -
(转)Ubuntu中设置环境变量的几种方式及区别
2013-07-14 16:07 12561, 为单一用户:.bashrc: 为每一个运行bash ... -
Ubuntu 程序“javac”已包含在下列软件包中
2013-07-12 16:45 9767xusongqin@xusongqin-F83VF: ... -
Linux配置环境变量
2013-06-28 17:37 7211.Linux的变量种类 按变量的生存周期来划分,L ... -
Quartz时间配置
2013-05-07 11:39 662Seconds YES 0-59 , - * / ... -
(转)x11vnc怎么手动启动和随系统自启动
2013-01-05 10:33 34751、手动启动x11vnc: 按组合键CTRL+ALT+T打开 ... -
(转)x11vnc怎么手动启动和随系统自启动
2013-01-05 09:53 01、手动启动x11vnc: 按组合键CTRL+ALT+T打开 ... -
linux scp Host key verification failed.
2012-12-21 11:27 1233sh-4.2$ scp -P37856 ./228203882 ...
相关推荐
### Ubuntu系统下挂载新硬盘 #### 显示硬盘及其分区情况 在Ubuntu系统中挂载新的硬盘之前,首先需要确认新硬盘是否已经被系统识别,并了解其当前的状态与分区情况。可以使用`fdisk -l`命令来查看硬盘的详细信息。 ...
CentOS 7 系统挂载新硬盘,扩充根目录磁盘空间 在本文中,我们将详细介绍如何在 CentOS 7 系统中挂载新硬盘,扩充根目录磁盘空间的步骤。这个过程涉及到多个 Linux 命令和概念,包括 fdisk、lvs、pvcreate、...
"Linux挂载新硬盘,开机自动挂载" 在 Linux 系统中,挂载新硬盘是非常常见的操作。下面我们将详细介绍 Linux 挂载新硬盘的步骤及其相关的知识点。 硬盘识别 在 Linux 中,可以使用 `fdisk -l` 命令来列出系统中...
"Linux 挂载新硬盘分区详解" Linux 挂载新硬盘分区是指在 Linux 系统中将新硬盘分区挂载到指定的挂载点,以便对硬盘进行读写操作。本文将详细介绍挂载新硬盘分区的步骤,包括划分硬盘新区、格式化新区、挂载新区和...
在Ubuntu系统中挂载新硬盘是一项基础而重要的操作,涉及到文件系统的管理和数据存储。以下是根据您提供的文件内容,详细解析在Ubuntu 20.04.2 LTS系统中如何挂载新硬盘的步骤和知识点。 1. 查询硬盘使用情况:使用...
在Linux系统中,挂载新硬盘是一个常见的任务,特别是在服务器管理中。以下是对Linux挂载新硬盘步骤的详细解释: 1. **购买和准备硬盘**: 首先,你需要在阿里云或其他云服务提供商处购买一块新的硬盘。选择合适的...
centos添加新磁盘 需要格式化并挂载,如果有大量新磁盘需要挂载,使用脚本就比较方便。挂载后还可以选择创建lvm
总的来说,“银河麒麟”系统硬盘挂载和分区的过程涉及对磁盘的检测、分区、创建LVM结构以及挂载逻辑卷。熟练掌握这些步骤对于日常的系统维护和管理至关重要,特别是对于那些需要高效利用存储资源和保持数据安全性的...
Linux下挂载新硬盘方法
Linux 新磁盘挂载到 home 目录 在 Linux 系统中,遇到磁盘空间不足的问题时,通常有两种解决方案:一是备份数据、重新安装系统、转移数据,二是增加新的磁盘。在生产环境中,增加新的磁盘是最合适的解决方案。下面...
挂载新硬盘的步骤以及问题的解决办法注意事项,当需要挂载>2T的硬盘时不能用传统的fdisk方法,需要用下面的方法
在Linux操作系统中,挂载新硬盘是一个常见的任务,特别是在服务器管理中。这涉及到识别新硬件、创建分区、格式化文件系统以及最终挂载到文件系统的某个点上。下面将详细介绍这个过程。 首先,你需要确定新硬盘已经...
Ubuntu系统硬盘扩容及挂载新硬盘,附件为操作说明和分区工具
在日常运维过程中,有时我们需要对服务器进行硬件升级或更换,比如挂载新的硬盘以扩大存储空间或迁移系统。本文将详细介绍如何在IBM 3650服务器上挂载已有系统的硬盘,确保数据的连续性和业务的正常运行。 #### 二...
通过挂载硬盘,我们可以将新的磁盘添加到系统中,并将其用于存储数据。本文将详细介绍如何在 Ubuntu 系统中挂载硬盘。 挂载硬盘的必要性 在现代计算机系统中,磁盘存储是不可或缺的一部分。随着数据存储需求的不断...
首先,添加新硬盘通常在物理服务器中涉及硬件更换或在虚拟环境中增加虚拟磁盘。对于虚拟机,如VirtualBox,可以在虚拟机设置中选择存储选项,添加一个新的SATA控制器,并创建虚拟硬盘。例如,创建一个名为...
本文档将详细介绍如何在CentOS 7中挂载新添加的硬盘,包括查询硬盘、分区、格式化以及设置开机自动挂载等步骤。 首先,要确认新添加的硬盘是否已经被系统识别。这可以通过运行`fdisk -l`命令来完成。这个命令会列出...
在Linux环境中,云服务器经常需要扩展存储空间,这就涉及到挂载新磁盘的操作。本文将详细介绍如何在Linux云服务器上挂载新磁盘,以便更好地管理和利用硬件资源。 首先,我们先了解一下挂载新磁盘的基本背景。假设你...
在挂载磁盘前,需要在文件系统中创建一个挂载点。在终端中输入`mkdir /data`,这会在根目录下创建名为"data"的目录,作为新磁盘的挂载点。 4. **手动挂载**: 执行`mount /dev/xvde1 /data`命令将分区挂载到`/...