Arch Linux 構(gòu)建 NFSROOT啟動的無盤系統(tǒng)

配置并編譯內(nèi)核參考:

https://www.cnblogs.com/kinglongmee/p/5043656.html

https://www.kernel.org/doc/Documentation/filesystems/nfs/nfsroot.txt

#編譯內(nèi)核參考文檔 Arch

https://wiki.archlinux.org/index.php/Kernels/Compilation/Traditional_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)#%E7%BC%96%E8%AF%91%E5%86%85%E6%A0%B8%E6%A8%A1%E5%9D%97

https://www.tldp.org/HOWTO/NFS-Root-4.html

原文參考: 如何制作nfs root 完整系統(tǒng)

https://wiki.archlinux.org/index.php/Diskless_system

https://wiki.archlinux.org/index.php/Diskless_system#NFS

參考文章:

https://www.bbsmax.com/A/gGdXyZYz4m/

NFS服務(wù)搭建,依賴nfs-utils包

具體配置:

vi /etc/exports

/srv? ? ? *(rw,fsid=0,no_root_squash,no_subtree_check)

/srv/arch? *(rw,no_root_squash,no_subtree_check)


構(gòu)建NFSROOT啟動的initramfs文件,使用內(nèi)核進行構(gòu)建,內(nèi)核需要已經(jīng)啟用NFS相關(guān)配置的內(nèi)核

Now the initramfs needs to be constructed.

NFS

Trivial modifications to the?net?hook are required in order for NFSv4 mounting to work (not supported by?nfsmount--the default for the?net?hook).

# sed s/nfsmount/mount.nfs4/ "$root/usr/lib/initcpio/hooks/net" > "$root/usr/lib/initcpio/hooks/netnfs4"

# cp $root/usr/lib/initcpio/install/net{,nfs4}

The copy of?net?is unfortunately needed so it does not get overwritten when?mkinitcpio-nfs-utils?is updated on the client installation.

Edit?$root/etc/mkinitcpio.conf?and add?nfsv4?to?MODULES,?netnfs4?to?HOOKS, and?/usr/bin/mount.nfs4?to?BINARIES.

Next, we?chroot?our installation and run?mkinitcpio:

# arch-chroot "$root" mkinitcpio -p linux


以下修改沒有理解;

# vim "$root/etc/fstab"

tmpfs? /var/log? ? ? ? tmpfs? ? nodev,nosuid? ? 0 0

tmpfs? /var/spool/cups tmpfs? ? nodev,nosuid? ? 0 0

但是貌似很重要


ipxe客戶端中的內(nèi)核啟動命令:

#下載內(nèi)核

kernel tftp://${net0/gateway}/arch/boot/x86_64/vmlinuz-linux548

initrd tftp://${net0/gateway}/arch/boot/intel_ucode.img

initrd tftp://${net0/gateway}/arch/boot/x86_64/initramfs-linux548.img

#內(nèi)核參數(shù) nfsroot= 參數(shù)中的 ‘:’ 特別重要

imgargs vmlinuz-linux548 initrd=intel_ucode.img initrd=initramfs-linux548.img root=/dev/nfs nfsroot=${net0/gateway}:/arch verify=n ip=dhcp imgtrust --allow

#啟動

boot

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容