zoukankan      html  css  js  c++  java
  • How to make Windows 7 USB flash install media from Linux?

    https://gist.github.com/kuznero/9eb62f6f0612a32d9c4446a4f1f4cf74

    • Install ms-sys - if it is not in your repositories, get it here. Or alternatively, make sure lilo is installed (but do not run the liloconfig step on your local box if e.g. Grub is installed there!)
    • Check what device your USB media is assigned - here we will assume it is /dev/sdb. Delete all partitions, create a new one taking up all the space, set type to NTFS (7), and remember to set it bootable:
    # cfdisk /dev/sdb
    or fdisk /dev/sdb (partition type 7, and bootable flag)
    
    • Create an NTFS filesystem (if this step produces error, you may need to reboot):
    # mkfs.ntfs -f /dev/sdb1
    
    • Write Windows 7 MBR on the USB stick (also works for windows 8), multiple options here:
    # ms-sys -7 /dev/sdb
    or (e.g. on newer Ubuntu installs) sudo lilo -M  /dev/sdb mbr (info)
    or (if syslinux is installed) sudo dd if=/usr/lib/syslinux/bios/mbr.bin of=/dev/sdb
    
    • Mount ISO and USB media:
    # mount -o loop win7.iso /mnt/iso
    # mount /dev/sdb1 /mnt/usb
    
    • Copy over all files:
    # cp -r /mnt/iso/* /mnt/usb/
    or use the standard GUI file-browser of your system
    
    • Call sync to make sure all files are written.

    ...and you're done.

    • After all that, you probably want to back up your USB media for further installations and get rid of the ISO file... Just use dd:
    # dd if=/dev/sdb of=/win7.img
    

    and reverse if/of next time you want to put the Windows 7 installer onto USB.

    As always, double check the device names very carefully when working with dd.

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    微信公众号:  共鸣圈
    欢迎讨论,邮件:  924948$qq.com       请把$改成@
    QQ群:263132197
    QQ:    924948

    良辰美景补天漏,风雨雷电洗地尘
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  • 相关阅读:
    SCI写作经典替换词,瞬间高大上!(转)
    最佳化常用测试函数 Optimization Test functions
    算法复杂度速查表
    VS 代码行统计
    CPLEX IDE 菜单栏语言设置( 中文 英文 韩文 等多国语言 设置)
    如何从PDF文件中提取矢量图
    Matlab无法打开M文件的错误( Undefined function or method 'uiopen' for input arguments of type 'char)
    visual studio 资源视图 空白 解决方案
    MFC DialogBar 按钮灰色不响应
    嗨翻C语言笔记(二)
  • 原文地址:https://www.cnblogs.com/welhzh/p/15374114.html
Copyright © 2011-2022 走看看