ubuntu16.04挂载新磁盘

[email protected]:~$

sudo fdisk -l

[sudo] password for wang: Disk /dev/loop0: 18.4 MiB, 19243008 bytes, 37584 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 /dev/loop1: 86.9 MiB, 91099136 bytes, 177928 sectors

Disk /dev/loop2: 86.6 MiB, 90812416 bytes, 177368 sectors

Disk /dev/loop3: 86.9 MiB, 91115520 bytes, 177960 sectors

Disk /dev/loop4: 18.5 MiB, 19410944 bytes, 37912 sectors

Ignoring extra data in partition table 5. Disk /dev/sda: 60 GiB, 64424509440 bytes, 125829120 sectors

Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 sectors

Disk /dev/sdc: 20 GiB, 21474836480 bytes, 41943040 sectors

[email protected]:~$ sudo -i [email protected]:~#

sudo fdisk /dev/sdc

Welcome to fdisk (util-linux 2.27.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command.

Device does not contain a recognized partition table. Created a new DOS disklabel with disk identifier 0x30d8c8fe.

Command (m for help):

m

Help:

DOS (MBR)

a toggle a bootable flag
b edit nested BSD disklabel
c toggle the dos compatibility flag

Generic

d delete a partition
F list free unpartitioned space
l list known partition types
n add a new partition
p print the partition table
t change a partition type
v verify the partition table
i print information about a partition
Misc
m print this menu
u change display/entry units
x extra functionality (experts only)

Script

I load disk layout from sfdisk script file
O dump disk layout to sfdisk script file

Save & Exit

w write table to disk and exit
q quit without saving changes

Create a new label

g create a new empty GPT partition table
G create a new empty SGI (IRIX) partition table
o create a new empty DOS partition table
s create a new empty Sun partition table

Command (m for help):

n

Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p):

p

Partition number (1-4, default 1): First sector (2048-41943039, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039):

Created a new partition 1 of type ‘Linux‘ and of size 20 GiB.

Command (m for help):

m

Help:

DOS (MBR) a toggle a bootable flag b edit nested BSD disklabel c toggle the dos compatibility flag

Generic d delete a partition F list free unpartitioned space l list known partition types n add a new partition p print the partition table t change a partition type v verify the partition table i print information about a partition

Misc m print this menu u change display/entry units x extra functionality (experts only)

Script I load disk layout from sfdisk script file O dump disk layout to sfdisk script file

Save & Exit w write table to disk and exit q quit without saving changes

Create a new label g create a new empty GPT partition table G create a new empty SGI (IRIX) partition table o create a new empty DOS partition table s create a new empty Sun partition table

Command (m for help): w

The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.

root@ubuntu:~# fdisk -l

Disk /dev/loop0: 18.4 MiB, 19243008 bytes, 37584 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 /dev/loop1: 86.9 MiB, 91099136 bytes, 177928 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 /dev/loop2: 86.6 MiB, 90812416 bytes, 177368 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 /dev/loop3: 86.9 MiB, 91115520 bytes, 177960 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 /dev/loop4: 18.5 MiB, 19410944 bytes, 37912 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

Ignoring extra data in partition table 5. Disk /dev/sda: 60 GiB, 64424509440 bytes, 125829120 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 Disklabel type: dos Disk identifier: 0x7f792d7e

Device Boot Start End Sectors Size Id Type /dev/sda1 * 2048 81788927 81786880 39G 83 Linux /dev/sda2 81790974 83884031 2093058 1022M 5 Extended /dev/sda3 81788928 81790973 2046 1023K 83 Linux /dev/sda5 81790976 83884031 2093056 1022M 82 Linux swap / Solaris

Partition table entries are not in disk order.

Disk /dev/sdb: 20 GiB, 21474836480 bytes, 41943040 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 Disklabel type: dos Disk identifier: 0x451fa6fd

Device Boot Start End Sectors Size Id Type /dev/sdb1 2048 41943039 41940992 20G 83 Linux

Disk /dev/sdc: 20 GiB, 21474836480 bytes, 41943040 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 Disklabel type: dos Disk identifier: 0x30d8c8fe

Device Boot Start End Sectors Size Id Type /dev/sdc1 2048 41943039 41940992 20G 83 Linux

[email protected]:~#

mkfs .ext3 /dev/sdc1

mke2fs 1.42.13 (17-May-2015) mkfs.ext2: invalid blocks ‘/dev/sdc1‘ on device ‘.ext3‘ [email protected]:~# mkfs.ext3 /dev/sdc1 mke2fs 1.42.13 (17-May-2015) Creating filesystem with 5242624 4k blocks and 1310720 inodes Filesystem UUID: 766c2620-d366-460d-b7ec-3a799ae9be49 Superblock backups stored on blocks: 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 4096000

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done Writing superblocks and filesystem accounting information: done

[email protected]:~#

sudo vim /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>
# / was on /dev/sda1 during installation
UUID=9cfc41d5-32f9-4d9f-a69c-1f4ae6a923c2 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=e4262916-28f9-4d52-8509-78ae291e15d8 none            swap    sw              0       0
/dev/fd0        /media/floppy0  auto    rw,user,noauto,exec,utf8 0       0
/dev/sdc1       /eos_private    ext3    defaults                 0       0
/dev/sdb1       /eth_private    ext3    defaults                 0       0

[No write since last change] /bin/bash: q: command not found

shell returned 127

Press ENTER or type command to continue [No write since last change] /bin/bash: q: command not found

shell returned 127

原文地址:https://www.cnblogs.com/ximen/p/9272305.html

时间: 2024-11-03 17:45:21

ubuntu16.04挂载新磁盘的相关文章

挂载新磁盘对文件目录扩容

1.新建一块足够的打的新磁盘并格式化 mkfs.ext4 /dev/sdb 2.新建目录/data/image mkdir -p /data/image 3.挂载到新目录/data/image mount /dev/sdb /data/image 4.停止Tomcat服务 service tomcat stop 5.将现有存储目录下的数据全面移到/data/image mv /usr/java/tomcat7/webapps/image/* /data/image 6.删除目录 /usr/jav

Linux下挂载新磁盘

Linux的硬盘识别: 一般使用"fdisk -l"命令可以列出系统中当前连接的硬盘 设备和分区信息.新硬盘没有分区信息,则只显示硬盘大小信息.   1.关闭服务器加上新硬盘   2.启动服务器,以root用户登录   3.查看硬盘信息 #fdisk -l [cpp] view plain copy Disk /dev/sda: 42.9 GB, 42949672960 bytes 255 heads, 63 sectors/track, 5221 cylinders Units = 

CentOS 7 环境下挂载新磁盘

最近某个项目需要给数据库服务器添加磁盘,由于太久没搞过,就给虚拟机加了10G的空间,用来练习一下磁盘的挂载 一. 首先执行"fdisk -l"命令,查看磁盘信息 [[email protected] ~]# fdisk -l 磁盘 /dev/sda:21.5 GB, 21474836480 字节,41943040 个扇区 Units = 扇区 of 1 * 512 = 512 bytes 扇区大小(逻辑/物理):512 字节 / 512 字节 I/O 大小(最小/最佳):512 字节

linux系统维护时的一些小技巧,包括系统挂载新磁盘的方法!可收藏!

这里发布一些平时所用到的小技巧,不多,不过会持续更新.... 1.需要将history创建硬链接ln 全盘需要备份硬链接 ln /etc/xxx /home/xxx 2.root用户不可以远程 /etc/ssh/sshd_config PermitRootLogin no AllowUsers XXX 3.同步软件时钟 date MMDDhhmmCCYY.ss hwclock --set --date="2011-08-14 16:45:05" 4.SSH服务重启及开关 ubuntu

Virtualbox中Linux添加新磁盘并创建分区

原文:https://www.linuxidc.com/Linux/2017-01/139616.htm ------------------------------------------------------------------ 引言:我们常常在使用系统的时候突然发现,哎呦~~~我们的磁盘空间不够用啦!我遇到常见的就是数据库数据暴增,预留的空间没有啦,只好新添加磁盘,在VB虚拟机上就可以实现,往往苦于没有图文并茂的好资料,下面我来为大家简单快捷的实操示范一下,做一名"实操族"

Centos挂载硬盘完整图文教程(查看、分区、格式化、挂载)磁盘

此教程是博主亲自帮朋友管理服务器所操作的完整步骤,当然此步骤适合所有的linux-centos系统,不管centos怎么变,linux怎么变,它的这些命令可以说是基本不变的:先说一下博主此教程所用的服务器的环境: 操作系统: CentOS 7.0 64位 运营商:阿里云服务器 可以参考宝塔教程:https://www.bt.cn/bbs/thread-5166-1-1.html Centos挂载磁盘完整图文教程: 1:查看服务器上未挂载的磁盘(磁盘有普通磁盘,高效磁盘,SSD磁盘):命令如下:

Ubuntu16.04 使用lvm挂载硬盘以及扩容

Ubuntu16.04 使用lvm挂载硬盘以及扩容 1.首先通过fdisk -l 查看磁盘的属性,找到要添加的磁盘名称(Disk /dev/sda) 2.使用fdisk将磁盘进行逻辑分区 fdisk /dev/sda m来查看命令帮助 n添加一张新的partition,之后都是划分几个分区,以及分区的大小,不过这些都可以使用默认的值,然后就可以直接按enter回车 最后通过w命令保存并退出 3.这个时候使用fdisk -l 我们会看到一个分区被创建出来: 4.这个时候我们可以使用lvm来管理这个

ubuntu16.04新服务器上配置selenium+firefox

ubuntu16.041安装pythonsudo apt-get install python默认2.7.122更新apt-getsudo apt-get update更新下apt-get库否则下载pip会出错3安装pipsudo apt-get install python-pip默认是8.1.14安装seleniumsudo pip install selenium5安装firefoxsudo apt-get install firefox6安装xvfbsudo apt-get instal

Linux新磁盘分区格式化及挂载-fdisk命令

本文主解决linux系统的磁盘分区格式化及挂载问题注意:分区操作针对磁盘vda,sda等vda1,sda1等是分区的名称 1.检查当前磁盘分区状态 1.1.查看分区挂载情况 df -h ------------------------------------------------------------------------------- [email protected]:~# df -h Filesystem Size Used Avail Use% Mounted on udev 7.