Why I cannot copy install.wim from Windows 7 ISO to USB (in linux env)

I need to make a USB bootable disk of Windows 7 ISO.

My USB is formatted to NTFS, ISO is not corrupt. I can copy install.wim elsewhere but I cannot copy it to USB. I even tried rsync.

rsync error

sources/install.wim
rsync: writefd_unbuffered failed to write 4 bytes to socket [sender]: Broken pipe (32)
rsync: write failed on "/media/52E866F5450158A4/sources/install.wim": Input/output error (5)
rsync error: error in file IO (code 11) at receiver.c(322) [receiver=3.0.8]

Stat for windows.vim

  File: `X15-65732 (2)/sources/install.wim'
  Size: 2188587580  Blocks: 4274600    IO Block: 4096   regular file
Device: 801h/2049d  Inode: 671984      Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/    umur)   Gid: ( 1000/    umur)
Access: 2011-10-17 22:59:54.754619736 +0300
Modify: 2009-07-14 12:26:40.000000000 +0300
Change: 2011-10-17 22:55:47.327358410 +0300

fdisk -l

Disk /dev/sdd: 8103 MB, 8103395328 bytes
196 heads, 32 sectors/track, 2523 cylinders, total 15826944 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xc3072e18

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1   *          32    15826943     7913456    7  HPFS/NTFS/exFAT

hdparm -I

/dev/sdd:
SG_IO: bad/missing sense data, sb[]:  70 00 05 00 00 00 00 0a 00 00 00 00 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

ATA device, with non-removable media
    Model Number:       UF�F�A����U]r���U   u��tF�f�`~
    Serial Number:      �@󾽀~|
    Firmware Revision:  ����V�
    Media Serial Num:   $I�vnladip raititnot baelErrrol aoidgn
    Media Manufacturer: o eparitgns syetmiM
Standards:
    Used: unknown (minor revision code 0x0c75) 
    Supported: 12 8 6 
    Likely used: 12
Configuration:
    Logical     max current
    cylinders   17218   0
    heads       0   0
    sectors/track   128 0
    --
    Logical/Physical Sector size:           512 bytes
    device size with M = 1024*1024:           0 MBytes
    device size with M = 1000*1000:           0 MBytes 
    cache/buffer size  = unknown
Capabilities:
    IORDY(may be)(cannot be disabled)
    Queue depth: 11
    Standby timer values: spec'd by Vendor
    R/W multiple sector transfer: Max = 0   Current = ?
    Recommended acoustic management value: 254, current value: 62
    DMA: not supported
    PIO: unknown
       *    reserved 69[0]
       *    reserved 69[1]
       *    reserved 69[3]
       *    reserved 69[4]
       *    reserved 69[7]
Security: 
    Master password revision code = 60253
    not supported
    not enabled
    not locked
    not frozen
    not expired: security count
    not supported: enhanced erase
    71112min for SECURITY ERASE UNIT. 172min for ENHANCED SECURITY ERASE UNIT.
Integrity word not set (found 0xaa55, expected 0x80a5)

Solution 1:

Well, the reason for this problem is because the file is >4.0 GB in size and the USB is formatted in FAT32 format. The max file size for FAT32 is 4GB. The max file size for FAT16 is only 2GB.

So how do you fix this problem? Well there are two ways you can go about it. You can either split the file into smaller pieces and then copy it to your external hard drive or you can convert the file system to NTFS, where there is no limit on file sizes.

Solution 2:

I had the same problem copying install.wim to USB flash drive (I tried several), so I changed the cluster size.

Right Click the drive, under USB, select Format, then change cluster size from 4096 (default) to 16 Kilobytes, and try to copy install.wim again.

Solution 3:

You cannot copy install.wim to a FAT32 partition, because FAT32 partitions do not allow files larger than 4 GB and the install.wim file is (slightly) larger than 4 GB. You can recompress the install.wim with "wimlib-imagex" with compression level "solid" using the following command:

wimlib-imagex optimize install.wim --solid

You may have to install WimLib:

sudo apt install wimtools

On Windows the tool is called "dism" and the compression level "recovery".

Source: tqdev.com