LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
12
返回列表 发新帖
楼主: axlrose

虚拟机中测试使用全btrfs + GPT 过程需要注意的事项[分享]

[复制链接]
 楼主| 发表于 2011-8-23 11:01:19 | 显示全部楼层
测试了一下将 subvolid=0中的 /boot 的所有东西移到 subvol=__active 的 /boot中
重启后引导失败,看来grub2也跟syslinux一样是认不到btrfs subvolume的boot的
还是用官方的方法才行,如果单独弄个分区来做 /boot 话更省事,目前使用官方的方法在
虚拟机中测试表现还不错
  1. 让压缩的卷快速变回没有压缩的
复制代码
看样子只是把mount -o 的选项关了压缩功能,但文件系统还是已被压缩的,目前还不晓得有啥好办法可以解决
开了lzo压缩后,pydf 查看好像没啥变化似的,没看到文件系统的空间被腾出更多的free空间来
回复 支持 反对

使用道具 举报

 楼主| 发表于 2011-8-23 11:33:45 | 显示全部楼层
编辑了一堆,不小给弄没了

https://wiki.archlinux.org/index.php/Syslinux
  1. GUID Partition Table aka GPT
  2. Main article GUID_Partition_Table
  3. Bit 2 of the attributes for the /boot partition need to be set.
  4. # sgdisk /dev/sda --attributes=1:set:2
  5. This would toggle the attribute legacy bios bootable on partition 1
  6. Verify:
  7. # sgdisk /dev/sda --attributes=1:show
  8. 1:2:1 (legacy BIOS bootable)
  9. Install the master boot record:
  10. # dd bs=440 conv=notrunc count=1 if=/usr/lib/syslinux/gptmbr.bin of=/dev/sda
复制代码

http://projects.archlinux.org/ar ... oot/installer/setup
中的# common syslinux funtion
  1.   if [[ "${GUID_DETECTED}" = '1' ]]; then
  2.         # Set Legacy BIOS Bootable GPT Partition Attribute using sgdisk
  3.         if ! [[ "$(sgdisk -i ${PARTITION_NUMBER} ${ROOTDEV} | grep '^Attribute' | grep '4$')" ]]; then
  4.             sgdisk ${ROOTDEV} --attributes=${PARTITION_NUMBER}:set:2
  5.         fi
复制代码

答案就在这里了,原来archboot 的安装器会去处理的,也只有像我这样因为之前习惯了gentoo的chroot方法,搞得现在安系统也是chroot而不去用官方安装器,不过这回是因为
archboot的parted用不来才这样搞的,不过这回搞清楚了,下回再手工安装也没啥问题了
  1. gptfdisk /sbin/fixparts
  2. gptfdisk /sbin/gdisk
  3. gptfdisk /sbin/sgdisk
复制代码
sgdisk 是个挺棒的命令行工具,以后写gpt自动安装脚本的时候能派上用场了
回复 支持 反对

使用道具 举报

发表于 2011-8-23 12:32:38 | 显示全部楼层
分区同样是 parted 用不来,挂了个 ubuntu 的盘分的……大概头上分了几m 的空闲再改了下 flag,archboot 选挂载点的时候就认了……当然,虚拟机没设 EFI……
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表