-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swap zeroing leads to fstab pointing to non-existent swap UUID #8
Comments
Thanks for the report! These are all very useful suggestions and the lack of swap is a pretty major oversight.
I'm curious about this. It does seem sensible but how have you found it handy? |
Maybe my bias comes from non-vm physical machines. With separate boot It's easier to change the file system or use LVM. One thing in my mind was eventually switching to btrfs file system (since it supports compression). |
dd has a low block size that causes the operation to go slower than it needs to. Relates to GH-8
The UUID is contained on the space that was cleared so CentOS didn't know how to handle the parition from fstab on the reboot. GH-8
I've opted to raise the swap size as per recommendations over at https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-ppc.html I'm not going to put the /boot on a separate partition as it seems to complicate the setup without a much benefit. I can see it's use on less transient machines though so thanks for the tip! |
Thanks once again for the report! |
Current approach of zeroing the swap partition is problematic:
https://github.com/2creatives/vagrant-centos/blob/master/ks.cfg#L221
The result is something like that:
The problem is that fstab contains the UUID of this partition (not device name or something else). And that UUID is destroyed by
dd
and re-generated bymkswap
.I can imagine two options to handle that:
a) Use
seek
parameter ofdd
to skip zeroing the header of the partition. And do not perform mkswap after that.b) Save the original UUID before the maintenance and then re-use it in mkswap. (Or alternatively - change the UUID in fstab). I think UUID can be extracted with
blkid
or listing/dev/disk/by-uuid
.Another problem is that
dd
is executed with default block size which is terribly slow. It should be changed to e.g. 1MB. E.g.:dd if=/dev/zero of=/dev/sdb1 bs=1024k seek=1
Another remark: maybe would be easier to manage the zeroing of free space and other operations too if using separate disk for swap. Also
/boot
partition is usually handy to have it in separate partition (in case of VM - easier to do that as separate disk).The text was updated successfully, but these errors were encountered: