求助,如何把 linux 系统制作成为 img 镜像

2014-07-16 14:42:07 +08:00
 chengxuan
树莓派sd卡,如何把linux系统制作成为img镜像。感谢各位。
8232 次点击
所在节点    Linux
8 条回复
chengxuan
2014-07-16 15:16:59 +08:00
急急急!!
rockagen
2014-07-16 15:29:36 +08:00
wait.i tell you how to use linux kernel build a linux system


First,you must have a installed linux system computer and compiled linux kernel.


let's go.

#dd if=/dev/zero of=sd.img bs=1M count=512

#losetup /dev/loop0 sd.img

#fdisk /dev/loop0 (create "/dev/loop0p1", "/dev/loop0p2" primary partitions,"loop0p1 is for boot partition,"loop0p2" is for root partition )

#mkfs -t ext2 /dev/loop0p1
#mkfs -t ext4 /dev/loop0p2

#mount /dev/loop0p1 /mnt/boot
#mount /dev/loop0p2 /mnt/root

now,
copy your compiled linux kernel (vmlinuz,system.map,initrd) files to boot partition
create some linux files and command(busybox?) on root partition(you can copy those files from you host system)

grub is come
#grub
##device (hd0) sd.img
##root (hd0,0)
##find /vmlinuz-xxx
##setup (hd0)

then create your menu.lst on /boot/grub folder

finally,you can modify this sd.img anytime anywhere if you want fuck her.

good luck!
nefuer
2014-07-16 15:29:47 +08:00
win32diskimager
tonyluj
2014-07-16 15:44:26 +08:00
我备份系统一般是:
sudo dd if=/dev/sda of=/mnt/backup/backup.img

缺点是全盘备份,未使用的也写入了。

看进度是: kill -USR1 pid
clino
2014-07-16 16:21:40 +08:00
我们之前用的是 remastersys
wangfeng3769
2014-07-16 16:23:12 +08:00
@rockagen
Are you a foreigner.
hzqim
2014-07-16 16:31:35 +08:00
clonezilla
我以前也有这样的问题: http://www.v2ex.com/t/101249#reply27
sandtears
2014-07-16 23:49:35 +08:00
如果你要装系统的话,去官网下镜像就好了。
如果你要自己做 dd if=/dev/sd<你的源磁盘> of=backup.img

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/122920

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX