LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (https://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   USB stick formatting compatible for windows reading, (https://www.linuxquestions.org/questions/linux-hardware-18/usb-stick-formatting-compatible-for-windows-reading-4175656305/)

galen 06-24-2019 03:17 PM

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

what am I missing?

slackware-current 06-24-2019 03:44 PM

from the slackware team
Code:

    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 :-)


jefro 06-25-2019 02:45 PM

If you are sure you know what you are doing then dd the drive to zero. (be sure you understand what I mean by be careful)

Then create a mbr partition and format it ntfs.

galen 06-26-2019 08:12 AM

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

colorpurple21859 06-26-2019 12:11 PM

Quote:

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.

galen 06-28-2019 07:10 AM

Quote:

Originally Posted by colorpurple21859 (Post 6009317)
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

beachboy2 06-28-2019 09:35 AM

galen,

Try this procedure to assess the condition of your SanDisk Cruiser USB drive.

Install dcfldd:
Code:

sudo apt install dcfldd
Assuming that your USB drive is sdc, zero out the drive using:
Code:

# dcfldd if=/dev/zero of=/dev/sdc bs=1M
Remove and reinsert USB drive and verify the zeroing by using:
Code:

# cmp /dev/zero /dev/sdc
The cmp will fail at the point when it has reached the end of the drive hopefully.

If it fails before then, the drive isn't usable any more.

My USB drive failed with this output:

Code:

akasa username # cmp /dev/zero /dev/sdc
/dev/zero /dev/sdc differ: byte 1011713, line 1

(The original suggestion for this procedure came from LQ member Shadow 7).

273 06-28-2019 01:33 PM

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?).

galen 06-28-2019 05:00 PM

Quote:

Originally Posted by 273 (Post 6010061)
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

273 06-28-2019 05:04 PM

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.

galen 06-28-2019 05:05 PM

Quote:

Originally Posted by beachboy2 (Post 6010017)
galen,

Try this procedure to assess the condition of your SanDisk Cruiser USB drive.

Install dcfldd:
Code:

sudo apt install dcfldd
Assuming that your USB drive is sdc, zero out the drive using:
Code:

# dcfldd if=/dev/zero of=/dev/sdc bs=1M
Remove and reinsert USB drive and verify the zeroing by using:
Code:

# cmp /dev/zero /dev/sdc
The cmp will fail at the point when it has reached the end of the drive hopefully.

If it fails before then, the drive isn't usable any more.

My USB drive failed with this output:

Code:

akasa username # cmp /dev/zero /dev/sdc
/dev/zero /dev/sdc differ: byte 1011713, line 1

(The original suggestion for this procedure came from LQ member Shadow 7).

ah yes, this something like I did years back (on smaller USB sticks), dd zero the stick then head & tail it to find anything odd. cmp looks better

business_kid 06-29-2019 02:07 PM

UDF works, as does ntfs-3g. I believe windows is phasing/has phased out iso9660, as you need to d/l drivers for it on some versions.

colorpurple21859 06-29-2019 04:41 PM

Quote:

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.

galen 06-30-2019 03:38 PM

Quote:

Originally Posted by colorpurple21859 (Post 6010397)
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

colorpurple21859 06-30-2019 03:53 PM

was the partition flagged as lba?
nevermind seen where you already tried that.


All times are GMT -5. The time now is 01:52 AM.