Ubuntu学习笔记

摘要:
根据提示,输入服务器用户名和密码。密码不会显示在屏幕上。格式化和挂载数据盘运行fdisk-l命令查看数据盘。[root@xxxx~]#fdisk-lDisk/dev/xvda:42.9GB,42949672960bytes255heads,63sectors/track,5221cylindersUnits=cylindersof16065*512=8225280bytesSectorsize:512bytes/512bytesI/Osize:512bytes/512bytesDiskidentifier:0x00078f9cDeviceBootStartEndBlocksIdSystem/dev/xvda1*152224194099283LinuxDisk/dev/xvdb:5368MB,5368709120bytes255heads,63sectors/track,652cylindersUnits=cylindersof16065*512=8225280bytesSectorsize:512bytes/512bytesI/Osize:512bytes/512bytesDiskidentifier:0x00000000执行命令进行分区fdisk/dev/xvdb根据提示,依次输入n,p,1,两次回车,wq,分区就开始了。Callingioctl()tore-readpartitiontable.Syncingdisks.执行fdisk-l命令,查看新的分区。新分区xvdb1已经创建好。如下面示例中的/dev/xvdb1。

1、远程终端连接

软件:putty

输入IP地址,要保存的名字,点击保存

Ubuntu学习笔记第1张

首次连接,会出现以下提示。单击是。

Ubuntu学习笔记第2张

根据提示,输入服务器用户名和密码。密码不会显示在屏幕上。输入完成后回车。

格式化和挂载数据盘

运行fdisk -l命令查看数据盘。

 [root@xxxx ~]# fdisk -l

 Disk /dev/xvda: 42.9 GB, 42949672960bytes
 255 heads, 63 sectors/track, 5221cylinders
 Units = cylinders of 16065 * 512 = 8225280bytes
 Sector size (logical/physical): 512 bytes / 512bytes
 I/O size (minimum/optimal): 512 bytes / 512bytes
 Disk identifier: 0x00078f9c
 Device Boot      Start         End      Blocks   Id  System
 /dev/xvda1   *           1        5222    41940992   83Linux

 Disk /dev/xvdb: 5368 MB, 5368709120bytes
 255 heads, 63 sectors/track, 652cylinders
 Units = cylinders of 16065 * 512 = 8225280bytes
 Sector size (logical/physical): 512 bytes / 512bytes
 I/O size (minimum/optimal): 512 bytes / 512bytes
 Disk identifier: 0x00000000

执行命令进行分区

fdisk /dev/xvdb

根据提示,依次输入n,p,1,两次回车,wq,分区就开始了。

[root@xxx ~]# fdisk /dev/xvdb
 Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklab            el
 Building a new DOS disklabel with disk identifier 0x33eb5059.
 Changes will remain in memory only, until you decide to writethem.
 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)

 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 forhelp): n
 Command action
    e   extended
    p   primary partition (1-4)
 p
 Partition number (1-4): 1First cylinder (1-652, default 1): 
 Using default value 1Last cylinder, +cylinders or +size{K,M,G} (1-652, default 652):
 Using default value 652
 Command (m forhelp): wq
 The partition table has been altered!
 Calling ioctl() to re-read partition table.
 Syncing disks.

执行fdisk -l命令,查看新的分区。新分区 xvdb1 已经创建好。如下面示例中的/dev/xvdb1。

 [root@xxx ~]# fdisk -l

 Disk /dev/xvda: 42.9 GB, 42949672960bytes
 255 heads, 63 sectors/track, 5221cylinders
 Units = cylinders of 16065 * 512 = 8225280bytes
 Sector size (logical/physical): 512 bytes / 512bytes
 I/O size (minimum/optimal): 512 bytes / 512bytes
 Disk identifier: 0x00078f9c
 Device Boot      Start         End      Blocks   Id  System
 /dev/xvda1   *           1        5222    41940992   83Linux

 Disk /dev/xvdb: 5368 MB, 5368709120bytes
 255 heads, 63 sectors/track, 652cylinders
 Units = cylinders of 16065 * 512 = 8225280bytes
 Sector size (logical/physical): 512 bytes / 512bytes
 I/O size (minimum/optimal): 512 bytes / 512bytes
 Disk identifier: 0x33eb5059
 Device Boot      Start         End      Blocks   Id  System
 /dev/xvdb1               1         652     5237158+  83  Linux

执行下列命令,对新分区进行格式化

 mkfs.ext3 /dev/xvdb1

执行下列命令写入新分区信息。

echo '/dev/xvdb1/mnt ext3 defaults 0 0'>> /etc/fstab

完成后,可以使用 cat /etc/fstab 命令查看。

免责声明:文章转载自《Ubuntu学习笔记》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇vue之templete模板Application.DoEvents()笔记下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

SQL SERVER 分区

“索引要与其基表对齐,并不需要与基表参与相同的命名分区函数。但是,索引和基表的分区函数在实质上必须相同,即: 1) 分区函数的参数具有相同的数据类型; 2) 分区函数定义了相同数目的分区; 3) 分区函数为分区定义了相同的边界值。” “先设计一个已分区表,然后为该表创建索引。执行此操作时,SQL Server 将使用与该表相同的分区方案和分区依据列自动对索...

打印调用API错误信息

char *dev = "/dev/hda "; /* open it */ fd = open(dev, O_RDONLY); if (fd == -1){ LOGD( "open %s failed %s\n ", dev, strerror(errno)); return (-1); }...

史上最全Linux提权后获取敏感信息方法

在本文开始之前,我想指出我不是专家。据我所知,在这个庞大的区域,没有一个“神奇”的答案.分享,共享(我的出发点)。下面是一个混合的命令做同样的事情,在不同的地方,或只是一个不同的眼光来看待事物。我知道有更多的“东西”去寻找。这只是一个基本粗略的指南。并不是每一个命令,做好要注重细节. 文中的每行为一条命令,文中有的命令可能在你的主机上敲不出来,因为它可能是...

【转】shell命令中>/dev/null 2>&1的实现原理

异步执行 exec("/alidata/server/php/bin/php /nas/wxdoctor/index.php App/Common/WordsPic/user_id/".$user_info['user_id']."/goods_id/".$goods_id."."/open_id/".$user_info['open_id']." &...

ubuntu上安装ffmpeg

引用:http://thierry-xing.iteye.com/blog/2017864 安装包和主要步骤: 1. 首先安装系统基础环境 RHEL & CentOS 系列:yum install -y automake autoconf libtool gcc gcc-c++ Debian & Ubuntu 系列:apt-get ins...

Centos7增加磁盘空间并挂载目录(VMware)

1.前言 今天本机vmware在使用docker安装oracle11g时提示nospace空间不足,所以用这篇文章简介下虚拟机如何扩展硬盘并挂载 2.添加新硬盘 依次点击"虚拟机"->"设置" 3.查看磁盘信息 fdisk -l 可以看到有4个磁盘,/dev/sda磁盘有两个分区,/dev/sdb磁盘为我这次新增的,但并未分区...