You are not logged in.

#1 2025-07-02 06:46:26

Bernadette
Member
Registered: 2025-06-08
Posts: 6

[SOLVED] How to write a folder on USB drive beside .iso image?

Hi! I want to create a bootable USB and to put drivers folder beside my .iso image. Firstly, I wrote zeroes on my USB drive using this command:

sudo dd if=/dev/zero of=/dev/sda bs=4096 conv=fsync oflag=direct status=progress

, got this output: 

1907201+0 records in

1907200+0 records out

7811891200 bytes (7.8 GB, 7.3 GiB) copied, 2188.11 s, 3.6 MB/s 

then I unmounted and formatted it:

sudo umount /dev/sda

sudo mkfs.vfat /dev/sda

Then I created a partition on it using gparted, and got this output in lsblk:

NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS

sda 8:0 1 7.3G 0 disk

└─sda1 8:1 1 7.3G 0 part

Then I wrote an .iso file into my USB using

sudo dd bs=4M if=/home/alex/Downloads/Win10_22H2_EnglishInternational_x64v1.iso of=/dev/sda conv=fsync oflag=direct status=progress

command and got this output:

1462+1 records in

1462+1 records out

6135633920 bytes (6.1 GB, 5.7 GiB) copied, 1396.19 s, 4.4 MB/s

As I understood later, dd command overwrites partition table, so now my partition is gone. I'm still need to put a folder with drivers on to my USB drive beside .iso image. I don't know how to do it, because I can't copy my folder into USB drive, or create a new folder inside it. My partition sda1 is disappeared, and when I try to mount sda itself, it says "source write-protected, mounted read-only". I heard I can use Ventoy for this kind of things, but is there any other way? I don't know what to do now and where is the problem. Would be thankful for your help.

Last edited by Bernadette (2025-07-02 13:40:25)

Offline

#2 2025-07-02 07:39:41

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,277

Re: [SOLVED] How to write a folder on USB drive beside .iso image?

As I understood later, dd command overwrites partition table

For "of=/dev/sda", yes (the DiskDestroyer writes any source into any destination and the destination here was the disk
=> when you type dd you need to understand every parameter you pass, you need to check that the issued devices are really what you think they are, then check that again and then read the dd command at least 5 times before hitting enter. Then pray wink
(ie. you need to make sure to be 100% correct when using dd - there're no training wheels with that command)

I'm still need to put a folder with drivers on to my USB drive beside .iso image.

Why? Can't you just mount any of the filesystems that now exist on /dev/sda1,2,3,4,… and put the folder there?

My partition sda1 is disappeared

sudo partprobe /dev/sda
lsblk -f
sudo file -s /dev/sda
sudo fdisk -l /dev/sda # edit: assuming there's actually a partition table

Last edited by seth (2025-07-02 07:40:38)

Offline

#3 2025-07-02 08:13:41

cryptearth
Member
Registered: 2024-02-03
Posts: 2,114

Re: [SOLVED] How to write a folder on USB drive beside .iso image?

given by the image name: as this is about windows install I suggest Ventoy
it'll setup your thumbdrive with a grub able to start iso images (or in case of windows media also supports wimboot) along with a exfat partition where the images and arbitrary data van be placed
you can also prepare the stick yourself by just format it with a single fat32 partition and just extract the iso instead of "burn" it - as this will place a <thumbdrive>\EFI\BOOT\BOOTX64.EFI which allows the stick to boot the install this way
if for some reason the install.wim doesn't fit (I don't know its size from the top of my head) create two partitions: first partition fat32 1gb and second partition rest of available size as exfat to put the install.wim

as for how to install windows with just the boot files, boit.wim and install.wim: google for "install windows the arch way"

Offline

#4 2025-07-02 09:51:13

wonderworld
Member
Registered: 2014-04-28
Posts: 31

Re: [SOLVED] How to write a folder on USB drive beside .iso image?

What you did:

> sudo dd if=/dev/zero of=/dev/sda bs=4096 conv=fsync oflag=direct status=progress
You did overwrite the whole device with zeros. No partition tables there, no data left
Input file /dev/zero just generates 00000000000000000 which you wrote to the device.
You do this to wipe data from a device. Not needed on a fresh device.

> sudo mkfs.vfat /dev/sda
You created a FAT partition on the whole device. No need to create another one in the next step with gparted.

> sudo dd bs=4M if=/home/alex/Downloads/Win10_22H2_EnglishInternational_x64v1.iso of=/dev/sda conv=fsync oflag=direct status=progress
You did overwrite everything you did before with a Windows iso. All partitioning before was overwritten here.

After all the resulting device *should* be mountable and you *should* be able to create a folder on it.
I am unsure if just writing the image to the stick would be enough to boot an actual Windows install. I think some EFI stuff might be missing.

If you want to create a bootable Windows installation-USB I'd recommend to use this tool which will do it for you:
https://aur.archlinux.org/packages/woeusb-ng

Offline

#5 2025-07-02 12:08:04

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 75,277

Re: [SOLVED] How to write a folder on USB drive beside .iso image?

After all the resulting device *should* be mountable and you *should* be able to create a folder on it.

Yes "should" … - we don't know what that iso actually holds, might be some  iso9660:

I try to mount sda itself, it says "source write-protected, mounted read-only"

in which case you're not gonna be able to write anything there.
You'd need to create a partitioned drive and write the iso to sda1 so you can have a fat-whatever on sda2 where you place extra data.
Or use ventoy to kinda do that for you.
Or use a second usb key wink

Offline

#6 2025-07-02 13:38:23

Bernadette
Member
Registered: 2025-06-08
Posts: 6

Re: [SOLVED] How to write a folder on USB drive beside .iso image?

Thank you all for your replies. I decided to use Ventoy and succeeded. I installed Ventoy on my USB drive, copied iso image into it, and then just copied my folder with drivers into it.

Offline

#7 2025-07-02 15:46:56

cryptearth
Member
Registered: 2024-02-03
Posts: 2,114

Re: [SOLVED] How to write a folder on USB drive beside .iso image?

if you need drivers for os install you should check your bios and set all sata ports to standard ahci and nvme slotsws to nvme and disable all other features like raid or other modes
require drivers on a modern win install always means your bios is setup in a way winpe not expect it to - which thanks to standard ahci and nvme drivers should not happen unless you enable crap like IntelRapidStorage or AMD fakeRaid

Offline

Board footer

Powered by FluxBB