一、常用的命令

  • mount:挂载文件系统
  • unmount:卸载文件系统
  • fdisk:硬盘分区命令
  • fdformat:格式化软盘
  • fsck:检查和修复文件系统
  • mkfs:创建文件系统
  • dd:转换和拷贝一个文件
  • genisoimage(mkisofs):创建一个ISO 9660映象文件
  • wodim(cdrecord):向光存储介质中写入数据
  • md5sum:计算MD5校验码

二、挂载、卸载存储设备

挂载:将该设备添加到文件树中,从而允许操作系统可以操作该设备,这个过程称为挂载。

/etc/fstab 文件列出了系统启动时挂载的设备。

使用mount命令,查看已经挂载的文件系统列表。

列表的格式是:device on mount_point type filesystem_type(options)

 /dev/sda2 on / type ext4 (rw)

以上表示dev/sda2设备挂载在根目录下,可读写.

首先切换到超级用户,再使用(umount)命令卸载设备。

[me@linuxbox ~]$ su -
Password:
[root@linuxbox ~]# umount /dev/sdc

然后为设备创建一个新的挂载节点,挂载节点仅仅是文件系统上的某个目录。

 [root@linuxbox ~]# mkdir /mnt/cdrom

使用 -t 选项指定文件系统类型:

 [root@linuxbox ~]# mount -t iso9660 /dev/sdc /mnt/cdrom

通过新建的挂载节点访问CD光盘的内容:

 [root@linuxbox ~]# cd /mnt/cdrom
[root@linuxbox cdrom]# ls

然后将目录切换到挂载节点以外的地方,卸载光盘:

 [root@linuxbox cdrom]# cd
[root@linuxbox ~]# umount /dev/sdc

经过上述操作,我们还需要确定设备的名称:


二、创建新的文件系统

使用fdisk命令进行磁盘分区,fdisk命令实现用户与磁盘设备进行较低层次的直接交互,该工具可以用来编辑、删除、创建设备分区。

 [me@linuxbox ~]$ sudo umount /dev/sdb1
[me@linuxbox ~]$ sudo fdisk /dev/sdb

然后输入m:

 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可以显示设备的分区表:

 Command (m for help): p
Disk /dev/sdb: MB, bytes
heads, sectors/track, cylinders
Units = cylinders of * = bytes
Device Boot Start End Blocks Id System
/dev/sdb1 + b W95 FAT32

未完待续....

The linux command 之存储媒介的更多相关文章

  1. 《The Linux Command Line》 读书笔记01 基本命令介绍

    <The Linux Command Line> 读书笔记01 基本命令介绍 1. What is the Shell? The Shell is a program that takes ...

  2. Linux Command Line 解析

    Linux Command Line 解析 0 处理模型 Linux kernel的启动包括很多组件的初始化和相关配置,这些配置参数一般是通过command line进行配置的.在进行后续分析之前,先 ...

  3. 《The Linux Command Line》 读书笔记04 Linux用户以及权限相关命令

    Linux用户以及权限相关命令 查看身份 id:Display user identity. 这个命令的输出会显示uid,gid和用户所属的组. uid即user ID,这是账户创建时被赋予的. gi ...

  4. 《The Linux Command Line》 读书笔记02 关于命令的命令

    <The Linux Command Line> 读书笔记02 关于命令的命令 命令的四种类型 type type—Indicate how a command name is inter ...

  5. Linux Command Line Basics

    Most of this note comes from the Beginning the Linux Command Line, Second Edition by Sander van Vugt ...

  6. 15 Examples To Master Linux Command Line History

    When you are using Linux command line frequently, using the history effectively can be a major produ ...

  7. 10 Interesting Linux Command Line Tricks and Tips Worth Knowing

    I passionately enjoy working with commands as they offer more control over a Linux system than GUIs( ...

  8. linux高级数据存储

    linux内此存储模式由5部分组成,自低向上的顺序: 物理卷,内核块设备驱动,内核文件系统驱动,虚拟文件系统,应用程序数据结构; 系统中所有的文件仅按此模式存储,无论是数据还是元数据,均在此模式下统一 ...

  9. Reso | The Linux Command Line 的中文版

    http://book.haoduoshipin.com/tlcl/book/zh/ 本书是 The Linux Command Line 的中文版, 为大家提供了多种不同的阅读方式. 中英文双语版- ...

随机推荐

  1. Java性能调优攻略全分享,5步搞定!(附超全技能图谱)

    对于很多研发人员来说,Java 性能调优都是很头疼的问题,为什么这么说?如今,一个简单的系统就囊括了应用程序.数据库.容器.操作系统.网络等技术,线上一旦出现性能问题,就可能要你协调多方面组件去进行优 ...

  2. 使用ProxyBroker构建代理池

    import asyncio from proxybroker import Broker async def show(proxies): while True: proxy = await pro ...

  3. pycharm的第一次使用(其实并不是第一次)

    file --> settings --> editor -->general --> change font size file --> settings --> ...

  4. <python练习题>python练习题(常练勿忘)

    学了python,去面试经常出现,某个或某些库不熟悉导则想不起来怎么写,知道思路而写不出来,多半还是不够熟悉,这里就作为熟悉python的地方,多做做题,多思考. 题目1:店铺ID为00000000- ...

  5. Excel函数——ANSI字符集与Code、Char、Asc函数

    小叙背景 Windows系统下,默认的字符集为ANSI,该字符编码方式在不同语言环境下采用不同的编码方案,在中文系统下ANSI编码是GBK.ANSI由ASCII扩展而来,ANSI下无论何种具体的编码方 ...

  6. Mybatis_环境搭建

    1.配置pom文件 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="h ...

  7. Windows server 2016 / Windows 10关于域管理员帐号权限不足的问题

    今天在测试windows server 2016的域创建时,当安装结束之后,发现使用Administrator用户进行操作时,被提示了权限不足这个问题.于是我在百度上查找了一番之后,找到了解决方法. ...

  8. fedora28 安装automake

    yum install automake yum install hg //版本管理

  9. Java判断链表是否为回文链表

    请判断一个链表是否为回文链表. 示例 1: 输入: 1->2 输出: false 示例 2: 输入: 1->2->2->1 输出: true 思路:1.通过快慢指针,来遍历链表 ...

  10. Vue开发实战

    递归组件 关键是组件在模板内能调用自身,关键是name属性 首先我们先定义数据格式 list: [ { title: '标题1' }, { title: '标题2', children: [ { ti ...