USB stick formatting compatible for windows reading,
Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
USB stick formatting compatible for windows reading,
I've been formatting USB sticks ex3 ext4 fat32 fat16 for more than a decade with gparted ...
but I am missing something
I'm doing the usual formatting an USB thumb drive msdos partition table.
one one fat32 partition
but MS Windows machines wont read it
It will boot up MX / puppy etc
Stick is a genuine Sandisk cruiser 32GB
there is no known hidden partition[s]
I've tried toggling boot, lba flags on it
shrunk the partition
still not being read under MS Windows
Take care about which device actually is your USB stick !!! The next
command will render all data on /dev/sdx inaccessible !!!
(1) First, wipe the bootsector of the USB stick:
dd if=/dev/zero of=/dev/sdx bs=512 count=1
(2) Then, create a new FAT32 partition on the stick and write a FAT32
filesystem on it (vfat or type b in fdisk terminology):
fdisk /dev/sdx <<EOF
n
p
1
t
b
w
EOF
mkdosfs -F32 /dev/sdx1
The 10 lines starting with 'fdisk /dev/sdx <<EOF' and ending with the
single word 'EOF' is actually one single command spread over ten lines,
including the two empty lines in the middle. This format is called a
'here-document'. It allows you to use a command which expects interactive
input in a non-interactive way. If you're uncomfortable with the above
command you can just run
fdisk /dev/sdx
and create a partition interactively :-)
I have in the past tried
shred /dev/sdb -n1 -z -v
gparted to make a new partition table with one partition
they should have done the trick, but no
I've tried GPT and MSDOS partition tables with gparted
then for example fat32 with flags msfdata, lba and a 2G fat32 partition at the end of the stick with the boot flag.
Here is what is working:
the big partition being read by windows machines and the fat32 boot partition being
used by fatdog64.
formatting the stick with one fat32 partition is not being read by windows machines
Maybe a stick over a certain size needs a boot partition
I seem to have this problem with the 32GB sandisk only. I've checked it and it is not a fake.
Hopefully I will remember this process for the next stick I format
2G fat32 partition at the end of the stick with the boot flag.
put the partition at the beginning of the usb. Windows will only see the first partition on the usb. If it doesn't recognize the partition window will pop up a window to format.
Last edited by colorpurple21859; 06-26-2019 at 12:12 PM.
put the partition at the beginning of the usb. Windows will only see the first partition on the usb. If it doesn't recognize the partition window will pop up a window to format.
I was figured that was the case, I didn't want the end partition to be formatted so I flagged it boot
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
I'm confused by the mentuion of "booting" Linux from the drive? If you can boot Linux from it tghen, chances are, the Linux distro was dd'd onto it ans contains an ext4 filesystem, surely?
If it's a data drive then I agree, much as it pains me, that NTFS may be the vest choice. Or there's the DVD filesystem I once managed to get working (UDFS?).
I'm confused by the mentuion of "booting" Linux from the drive? If you can boot Linux from it tghen, chances are, the Linux distro was dd'd onto it ans contains an ext4 filesystem, surely?
If it's a data drive then I agree, much as it pains me, that NTFS may be the vest choice. Or there's the DVD filesystem I once managed to get working (UDFS?).
clarifying,
I wanted to use the stick as data transfer requiring it to be read by windows machines
and
to have it boot linux
I did wipe the drive before with dd and shred
tried it with GPT partition table and MSDOS
I could format this disk under gparted but win would not read it
I could format under win then when I added unetbootin to it win would no longer read it,
only when I made 2 partitions would it do both tasks, although w 2 partitions.
1st is used for data transfer fat32, 2nd is used for fatdog64 bootup
the OS that I was using was MX linux and it has its own way of partitioning the stick but I did not want a MX boot USB stick
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680
Rep:
What you just described is exactly how things should work. You can't use a Linux install partition as storage for Windows since it's going to be a Linux filesystem, so you would need two partitions.
1st is used for data transfer fat32, 2nd is used for fatdog64 bootup
the reason it worked this way is fat32 was first partition on disk and windows can only read the first partition on a usb stick. When you reverse and put the fat32 second on usb stick windows has issues.
the reason it worked this way is fat32 was first partition on disk and windows can only read the first partition on a usb stick. When you reverse and put the fat32 second on usb stick windows has issues.
thanks, but that is not what is happening, as I posted the stick partitions were fat32, the second one had to be flagged boot to work
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.