mount rootfs
主要用到的命令为pivot_root,可man 8 pivot_root了解用法。
1. pivot_root - change the root filesystem
pivot_root new_root put_old
pivot_root moves the root file system of the current process to the directory put_old and makes new_root the new root file system.
Note that, depending on the implementation of pivot_root, root and cwd of the caller may or may not
change. The following is a sequence for invoking pivot_root that works in either case, assuming that
pivot_root and chroot are in the current PATH:
cd new_root
pivot_root . put_old
exec chroot . command
Note that chroot must be available under the old root and under the new root, because pivot_root may
or may not have implicitly changed the root directory of the shell.
Note that exec chroot changes the running executable, which is necessary if the old root directory
should be unmounted afterwards. Also note that standard input, output, and error may still point to
a device on the old root file system, keeping it busy. They can easily be changed when invoking chroot.
2. 应用
pivot() { # <new_root> <old_root>
/bin/mount -o noatime,move /proc $/proc && \
pivot_root $ $$ && {
/bin/mount -o noatime,move $/dev /dev
/bin/mount -o noatime,move $/tmp /tmp
/bin/mount -o noatime,move $/sys /sys >&-
/bin/mount -o noatime,move $/overlay /overlay >&-
return
}
}
mount rootfs的更多相关文章
- android使用mount挂载/system/app为读写权限,删除或替换系统应用
注意:以下代码中#开头的则为需要执行的shell命令,其他的为打印的结果.#代表需要使用ROOT权限(su)执行,所以想要修改您android手机某个目录挂载为读写,首先需要有ROOT权限! 先要得到 ...
- ubifs概述
UBIFS无排序区块图像文件系统(Unsorted Block Image File System, UBIFS)是用于固态存储设备上,并与LogFS相互竞争,作为JFFS2的后继文件系统之一.真正开 ...
- easycwmp在开发板上的配置
原创作品,转载请注明出处 copyright:weishusheng 2015.3.18 email:642613208@qq.com 平台: Linux version 2.6.32-279.e ...
- Android shell 下 busybox,clear,tcpdump、、众多命令的移植
http://my.oschina.net/mopidick/blog/167372 作为一名Android开发者,经常需要进入Android 的shell终端运行一些命令.但是我们发现Android ...
- Android 启动过程简析
首先我们先来看android构架图: android系统是构建在linux系统上面的. 所以android设备启动经历3个过程. Boot Loader,Linux Kernel & Andr ...
- 用Qemu模拟vexpress-a9 (四) --- u-boot引导kernel,用nfs挂载根文件系统
环境介绍 Win7 64 + Vmware 11 + ubuntu14.04 32 u-boot 版本:u-boot-2015-04 Linux kernel版本:linux-3.16.y busyb ...
- Nexus4铃声目录
1. 我的铃声 是通过下面的命令 传到手机上面去的: “ adb push fringe_01_long.mp3 /sdcard/ZC/ adb push fringe_02_short.mp3 /s ...
- Linux_常用命令_03_磁盘/挂载_信息查看
1. 1.1. mount 不带参数的话,显示的是 当前已经挂载的情况 1.2. df 不带参数的话,硬盘分区状况查询 2. 2.1. cat /proc/partitions 2.2. fdisk ...
- 自己搭建Wifi Pineapple Mark V
创业搞得自己很累,不过一切都是值得的.抽空写下文章,确实好久未更新了. 前段时间由于项目需要,所以就折腾了下wifi pineapple.时间间隔有点久,根据回忆记录下. 淘宝货:TP-Link TL ...
随机推荐
- python之装饰器、生成器、内置函数、JSON
一.装饰器: 装饰器,器在这里的意思是函数,也就是装饰函数.作用是给其他函数添加新功能,它可以不改变原有的函数,原来的函数和原来一模一样,什么都不需要改变,只需要在函数外部加上调用哪个装饰器就可以了, ...
- iOS使用CoreData实现收藏功能
一般做收藏都是使用数据库或者归档,使用CoreData实现收藏功能就是没事时练一下,实现大概和数据库差不多. 首先创建一个工具类继承NSObject,在里面实现所需要的方法. 工具类的.h文件: ty ...
- Linux下CURL设置请求超时时间
使用CURL时,有两个超时时间:一个是连接超时时间,另一个是数据传输的最大允许时间. 连接超时时间用--connect-timeout参数来指定,数据传输的最大允许时间用-m参数来指定. 例如: cu ...
- 【转载】【Todo】Nodejs的优缺点
Nodejs的优缺点,这里面讲的比较详细.有时间可以多看看别人的分析. https://www.zhihu.com/question/19653241 Node.js 的架构与 Django, Rai ...
- Linux内核分析(三)内核启动过程分析——构造一个简单的Linux系统
一.系统的启动(各历史节点) 在最开始的时候,计算机的启动实际上依靠一段二进制码,可以这么理解,他并不是一个真正的计算机启动一道程序.计算机在开始加电的时候几乎是没有任何用处的,因为RAM芯片中包括的 ...
- D3.js系列——布局:饼状图和力导向图
一.饼状图 在布局的应用中,最简单的就是饼状图. 1.数据 有如下数据,需要可视化: , , , , ]; 这样的值是不能直接绘图的.例如绘制饼状图的一个部分,需要知道一段弧的起始角度和终止角度,这些 ...
- 深入理解CommonJS!
CommonJS 一开始大家都认为JS是辣鸡,没什么用,官方定义的API只能构建基于浏览器的应用程序,CommonJS就按耐不住了,CommonJS API定义很多普通应用程序(主要指非浏览器的应用) ...
- zclip结合easyui实现复制datagrid每行特定单元格数据的功能
在easyui的datagrid里面,实现复制每行特定单元格的功能,关键是想想如何获取到每个单元格的数据,功能是点击按钮"复制",然后复制object的下载地址,截图如下所示: 进 ...
- 利用 MySQL 技能学习 DB2 Express: DB2 与 MySQL 的管理任务和基本任务
原文地址:http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0602tham2/index.html 简单介绍 管理不 ...
- react-native-storage + AsyncStorage 实现数据存储
1.组件封装 import Storage from 'react-native-storage'; import { AsyncStorage } from 'react-native'; cons ...