[软件技巧] Windows一键重装系统为Linux (netboot,网络安装)
作者:精品下载站 日期:2019-10-29 13:52:21 浏览:2420 分类:玩电脑
文章核心内容转载自@萌咖大佬!
特别提醒:一键重装有一定的风险,请做好数据备份,做好抢救方案!
有些厂商的机器因策略问题,不支持Windows重装为Linux. 例如: 腾讯云非大陆区域.
有些厂商Windows系统盘会比Linux系统盘大,想要大一点系统盘. 例如: AZURE.
有些厂商不支持VNC,这对于转换系统实在不方便.
这篇文章可以解决以上问题.
使用前,请耐心看完文章.
如果造成损失,萌咖(原大佬)不负任何责任.
使用方法
下载 win32loader.bat (分流下载:https://pan.baidu.com/s/1UyEn7B4OPa7jmqANzPYHdQ). 双击打开此文件. 自行选择选项. 按回车重启,并等待安装完成.
注意事项
如果对提供安装的发行版不满意,请参考此文章:CentOS/Debian/Ubuntu网络重装系统一键脚本
默认提供的是Debian8(Jessie),添加了firmware包,提供了更多的驱动支持,DHCP模式一键.
非DHCP模式,如果要一键,则需要自己定制镜像.
定制Debian系镜像应该没问题,其他未作测试.
默认root账户密码 Vicer .
如需要Linux一键重装为Windows,请参考:
叒一个!一键全自动 DD 安装 Windows系统
Linux全自动一键DD安装Windows系统
如果厂商不支持VNC,则需要自己定制镜像.
定制方法参考上面提到的:CentOS/Debian/Ubuntu网络重装系统一键脚本
主要在镜像中添加机器的网络参数,以便支持一键安装.
命令示例:
bash InstallNET.sh -d 8 -v 64 -a --ip-addr <IP> --ip-mask <NetMask> --ip-gate <GATE> --loader |
完成后将 initrd.img
和 vmlinuz
存放到能直链下载的位置.
如果厂商支持VNC,则可以直选全部选 1 .
安装的时候,自己填 IP地址,子网掩码, 网关, DNS服务器.
DNS服务器推荐填: 8.8.8.8
区分是否为DHCP模式
非DHCP模式: 如上图,显示了详细的IP地址.(选项为:使用下面的IP地址)
DHCP模式: 参考上图.(选项为:自动获得IP地址)
源码备份
@ECHO OFF&PUSHD %~DP0 &TITLE Win32Loadersetlocal enabledelayedexpansion::Author MoeClub.orgcolor 87cd.>%windir%\GetAdminif exist %windir%\GetAdmin (del /f /q "%windir%\GetAdmin") else (echo CreateObject^("Shell.Application"^).ShellExecute "%~s0", "%*", "", "runas", 1 >> "%temp%\Admin.vbs""%temp%\Admin.vbs"del /s /q "%temp%\Admin.vbs"exit /b 2)cls echo * Init Win32Loader.set URL=https://moeclub.org/attachment/WindowsSoftware set download=0set try_download=1 :Initmkdir "%SystemDrive%\win32-loader" >NUL 2>NULif exist "%SystemDrive%\Windows\System32\WindowsPowerShell" (set use_ps=1) else (set use_ps=0) if %use_ps% equ 1 (goto InitIt) else (goto InitFail) :InitItset try_download=0powershell.exe -command "& {$client = new-object System.Net.WebClient; $client.DownloadFile('!URL!/g2ldr/g2ldr','%SystemDrive%\g2ldr')}" >NUL 2>NULpowershell.exe -command "& {$client = new-object System.Net.WebClient; $client.DownloadFile('!URL!/g2ldr/g2ldr.mbr','%SystemDrive%\g2ldr.mbr')}" >NUL 2>NULpowershell.exe -command "& {$client = new-object System.Net.WebClient; $client.DownloadFile('!URL!/g2ldr/grub.cfg','%SystemDrive%\win32-loader\grub.cfg')}" >NUL 2>NULgoto InitDone :InitFailecho Not found powershell, please download them by yourself.echo '%SystemDrive%\g2ldr'echo '%SystemDrive%\g2ldr.mbr'echo '%SystemDrive%\win32-loader\grub.cfg'echo Press [ENTER] when you finished.pause >NUL 2>NULgoto InitDone :InitDoneif !try_download! equ 0 (set InitOption=InitFail) else (set InitOption=Init)if not exist "%SystemDrive%\g2ldr" goto !InitOption!if not exist "%SystemDrive%\g2ldr.mbr" goto !InitOption!if not exist "%SystemDrive%\win32-loader\grub.cfg" goto !InitOption! :Imageecho.echo * Please select initrd mode.echo [1] Online downloadecho [2] Local filechoice /n /c 12 /m Select:if errorlevel 2 goto LocalModeif errorlevel 1 goto OnlineModegoto Image :OnlineModeecho.echo * Please select source.echo [1] by MoeClub (DHCP or VNC Support)echo [2] by yourselfchoice /n /c 12 /m Select:if errorlevel 2 goto Yourselfif errorlevel 1 goto MoeClubgoto OnlineMode:Yourselfecho.echo if 'initrd.img' URL is 'https://moeclub.org/onedrive/IMAGE/Loader/DebianJessie/initrd.img', Please input 'https://moeclub.org/onedrive/IMAGE/Loader/DebianJessie'.set /p IMG_URL=URL :if defined IMG_URL (goto Download) else (goto MoeClub):MoeClubset IMG_URL=https://moeclub.org/onedrive/IMAGE/Loader/DebianJessiegoto Download:Downloadif %use_ps% equ 1 (echo.echo Downloading 'initrd.img'...powershell.exe -command "& {$client = new-object System.Net.WebClient; $client.DownloadFile('!IMG_URL!/initrd.img','%SystemDrive%\win32-loader\initrd.img')}" >NUL 2>NULecho Downloading 'vmlinuz'...powershell.exe -command "& {$client = new-object System.Net.WebClient; $client.DownloadFile('!IMG_URL!/vmlinuz','%SystemDrive%\win32-loader\vmlinuz')}" >NUL 2>NULset download=1) else (echo Not support online download, auto change Local initrd.goto LocalMode) :LocalModeif !download! equ 0 (echo.echo Please put 'initrd.img' and 'vmlinuz' to '%SystemDrive%\win32-loader' .echo Press [ENTER] when you finished.pause >NUL 2>NUL) :Done0set download=0if exist "%SystemDrive%\win32-loader\initrd.img" (goto Done1) else (echo Not found '%SystemDrive%\win32-loader\initrd.img' .goto LocalMode) :Done1set download=0if exist "%SystemDrive%\win32-loader\vmlinuz" (goto Done) else (echo Not found '%SystemDrive%\win32-loader\vmlinuz' .goto LocalMode) :Doneecho.echo Press [ENTER] to reboot...pause >NUL 2>NULif not exist "%SystemDrive%\g2ldr" echo Not found '%SystemDrive%\g2ldr' . && exit 1if not exist "%SystemDrive%\g2ldr.mbr" echo Not found '%SystemDrive%\g2ldr.mbr' . && exit 1if not exist "%SystemDrive%\win32-loader\grub.cfg" echo Not found '%SystemDrive%\win32-loader\grub.cfg' . && exit 1if not exist "%SystemDrive%\win32-loader\initrd.img" echo Not found '%SystemDrive%\win32-loader\initrd.img' . && exit 1if not exist "%SystemDrive%\win32-loader\vmlinuz" echo Not found '%SystemDrive%\win32-loader\vmlinuz' . && exit 1set id={01234567-89ab-cdef-0123-456789abcdef}bcdedit /create %id% /d "Debian GUN/Linux" /application bootsector >NUL 2>NULbcdedit /set %id% device partition=%SystemDrive% >NUL 2>NULbcdedit /set %id% path \g2ldr.mbr >NUL 2>NULbcdedit /displayorder %id% /addlast >NUL 2>NULbcdedit /bootsequence %id% /addfirst >NUL 2>NULshutdown -r -t 0 |
No related posts.
猜你还喜欢
- 03-03 [系统]Win10 企业版 2016 长期服务版极限精简版
- 03-03 [系统]Win10 2016 LTSB v14393.2035精简版本
- 03-03 [系统]Windows10 RS3 16299.194 企业版精简版
- 03-03 [系统]Windows10 RS3 v16299.192 纯净版合集
- 03-03 [系统]Windows10 RS3 16299.125 专业版精简版
- 03-03 [系统]Win10 RS3 v16299.98 专业版精简优化版
- 03-03 [系统]Windows 10 神州网信政府版官方镜像下载!
- 03-03 [系统]Windows 10 RS3 v16299.64政府版精简版
- 03-03 [系统]Windows 10 RTM专业版中文精简版
- 03-03 [系统]Windows 10 RTM正式版WinPE企业版
- 03-03 [系统]Windows 10 RTM 企业版LTSB精简版
- 03-03 [系统]Wind 10 RS2 v1703 VOL 专业版精简版
取消回复欢迎 你 发表评论:
- 精品推荐!
-
- 最新文章
- 热门文章
- 热评文章
[软件合集] 25年5月31日 精选软件66个
[电影] 黄沙漫天(2025) 4K.EDRMAX.杜比全景声 / 4K杜比视界/杜比全景声
[风口福利] 短视频红利新风口!炬焰创作者平台重磅激励来袭
[韩剧] 宝物岛/宝藏岛/金银岛(2025)【全16集】【朴炯植/悬疑】
[电影] 愤怒的牦牛 (2025) 国语中字 4k
[短剧合集] 2025年05月30日 精选+付费短剧推荐56部
[软件合集] 25年5月30日 精选软件26个
[软件合集] 25年5月29日 精选软件18个
[短剧合集] 2025年05月28日 精选+付费短剧推荐38部
[软件合集] 25年5月28日 精选软件37个
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电视剧] 欢乐颂.5部全 (2016-2024)
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[影视] 【稀有资源】香港老片 艺坛照妖镜之96应召名册 (1996)
[剧集] 神经风云(2023)(完结).4K
[剧集] [BT] [TVB] [黑夜彩虹(2003)] [全21集] [粤语中字] [TV-RMVB]
[资源] B站充电视频合集,包含多位重量级up主,全是大佬真金白银买来的~【99GB】
[影视] 内地绝版高清录像带 [mpg]
[书籍] 古今奇书禁书三教九流资料大合集 猎奇必备珍藏资源PDF版 1.14G
[美图] 2W美女个美女小姐姐,饱眼福
[电视剧] [突围] [45集全] [WEB-MP4/每集1.5GB] [国语/内嵌中文字幕] [4K-2160P] [无水印]
[剧集] [央视][笑傲江湖][2001][DVD-RMVB][高清][40集全]李亚鹏、许晴、苗乙乙
[电影] 美国队长4 4K原盘REMUX 杜比视界 内封简繁英双语字幕 49G
[电影] 死神来了(1-6)大合集!
[软件合集] 25年05月13日 精选软件16个
[精品软件] 25年05月15日 精选软件18个
[绝版资源] 南与北 第1-2季 合集 North and South (1985) /美国/豆瓣: 8.8[1080P][中文字幕]
[软件] 25年05月14日 精选软件57个
[短剧] 2025年05月14日 精选+付费短剧推荐39部
[短剧] 2025年05月15日 精选+付费短剧推荐36部
- 最新评论
-
- 热门tag