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 ...
随机推荐
- MathType如何插入连乘
这个就是连乘符号,只不过看着不习惯......就在眼皮子底下.
- 连接zookeeper集群
连接到ZooKeeper集合 ZooKeeper类通过其构造函数提供connect功能.构造函数的签名如下 : ZooKeeper(String connectionString, int sessi ...
- activemq 5.13.2 jdbc 数据库持久化 异常 找不到驱动程序
原文:https://my.oschina.net/u/2284972/blog/662033 摘要: activemq jdbc 数据库持久化 异常 找不到驱动程序 Caused by: java. ...
- React脚手架
所谓脚手架,是指一套基础的开发环境,你只需要简单的配置或者无需配置,就可以直接开发自己的业务代码,而无需劳神在搭建环境上. 比较出名的就是facebook自己出的的脚手架:create-react-a ...
- 【转载】【Todo】Nodejs的优缺点
Nodejs的优缺点,这里面讲的比较详细.有时间可以多看看别人的分析. https://www.zhihu.com/question/19653241 Node.js 的架构与 Django, Rai ...
- IE漏洞调试之CVE-2013-3893
前言 Windows平台的漏洞挖掘和安全研究中,IE始终是绕不开的话题.IE漏洞就跟adobe系列一样经典,是学习exploit.shellcode的绝佳途径. 在IE漏洞中,UAF即Use-Afte ...
- Oracle中分页查询语句的写法
要动态的变化分页查询的条件,比如pageNow 这个变量表示的是当前是第几页, oracle分页有通用写法,假设一页5行 select * from ( select t.*,rownum rn fr ...
- ubuntu14.04 配置tomcat8
ubuntu下配置tomcat的过程事实上和windows是差点儿相同的,以下一起来看一下怎样在ubuntu14.04中配置tomcat. 1.下载tomcat 地址:http://tomcat.ap ...
- (转)JavaScript: in, hasOwnProperty, delete, for/in
in 运算符 判断对象是否拥有某一属性只要对象拥有该属性,就会返回true,否则false var point = { x:1, y:1 };alert( 'x' in point ); //tru ...
- jquery 事件,注册 与重复事件处理
jquery有时候会出现重复注册一个事件的问题,导致点击一个事件,这个事件被重复执行,也就是触发事件的次数有几次, 那么这个事件就会被执行叠加重复几次. 我这边做的一个项目,在某个页面初始化的时候,给 ...