使用DD建立新分区并且 打包需要的文件 成为 img 记录

都忘记了,哎,每次 百度 狗狗 ,累

 dd if=/dev/zero of=custom.img bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.338186 s, 3.2 GB/s
 

 ls custom.img  -l
-rw-r--r-- 1 root root 1073741824 Aug 13 17:08 custom.img
 mkdir custom
 chmod 777 -R custom

mount -o loop custom.img custom
mount: /mnt/data/ailiving/Workfolder/carl/aili/d/d-3/sc60_android7.1.2_ailiving/out/target/product/msm8953_64/custom: wrong fs type, bad option, bad superblock on /dev/loop3, missing codepage or helper program, or other error.
 

 mkfs.ext4 custom.img
mke2fs 1.44.1 (24-Mar-2018)
Discarding device blocks: done
Creating filesystem with 262144 4k blocks and 65536 inodes
Filesystem UUID: fea7199b-0ee0-4b5e-bf92-6aca388a95ed
Superblock backups stored on blocks:
        32768, 98304, 163840, 229376

Allocating group tables: done
Writing inode tables: done
Creating journal (8192 blocks): done
Writing superblocks and filesystem accounting information: done
 

 mount -o loop custom.img custom

chmod 7777 -R custom

umount custom

 

file custom.img
custom.img: Linux rev 1.0 ext4 filesystem data, UUID=fea7199b-0ee0-4b5e-bf92-6aca388a95ed (extents) (64bit) (large files) (huge files)
 

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值