|
本帖最后由 2011niumao 于 2020-6-12 19:58 编辑
还有一种情形,需要注意
就是先进入squashfs系统,在这个系统下修改vhd系统中的/etc/fstab文件,把它的根分区 / 那一行修改正确.
在制作squashfs文件系统时候,会注释掉 / 这一行,如下- # /etc/fstab: static file system information.
- #
- # Use 'blkid -o value -s UUID' to print the universally unique identifier
- # for a device; this may be used with UUID= as a more robust way to name
- # devices that works even if disks are added and removed. See fstab(5).
- #
- # <file system> <mount point> <type> <options> <dump> <pass>
- proc /proc proc nodev,noexec,nosuid 0 0
- ###/dev/sda10
- ###UUID=29b92931-2ac3-4720-a5ed-40b9a3cc1241 / ext4 errors=remount-ro 0 1
复制代码 这里的UUID前面的三个###是注释掉这一行的意思. 进入squashfs系统后,挂载vhd文件,将这三个###号去掉,运行blkid查询出正确的uuid,替换掉那一串字母数字组合,保存,
- # /etc/fstab: static file system information.
- #
- # Use 'blkid -o value -s UUID' to print the universally unique identifier
- # for a device; this may be used with UUID= as a more robust way to name
- # devices that works even if disks are added and removed. See fstab(5).
- #
- # <file system> <mount point> <type> <options> <dump> <pass>
- proc /proc proc nodev,noexec,nosuid 0 0
- ###/dev/sda10
- UUID=812c1d35-3253-4a11-88db-e2e0834bf717 / ext4 errors=remount-ro 0 1
复制代码 (这里UUID后面是随便写的,需要更换为vhd中linux系统的根分区的uuid).重启后就可以进入了.
在squashfs 文件系统中需执行以下命令- sudo kpartx -av VHD文件名(带路径)
- sudo mount /dev/mapper/loop8px /mnt
- sudo blkid
- sudo gedit /mnt/etc/fstab
- sudo umount /mnt
- sudo kpartx -d /dev/loop8
- sudo losetup -d /dev/loop8
- sudo reboot
复制代码 |
|