LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-24-2019, 03:17 PM   #1
galen
Member
 
Registered: Sep 2003
Location: Halifax, Nova Scotia, Canada
Distribution: MX, Xubuntu, Zorin. BOYCOTTING: Vector, Beatrix, BLAG, Slackware. Life banned from: Facebook, Yahoo!
Posts: 190
Blog Entries: 1

Rep: Reputation: Disabled
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?
 
Old 06-24-2019, 03:44 PM   #2
slackware-current
Member
 
Registered: Jun 2019
Posts: 60

Rep: Reputation: 6
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 :-)
 
1 members found this post helpful.
Old 06-25-2019, 02:45 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,008

Rep: Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629Reputation: 3629
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.
 
Old 06-26-2019, 08:12 AM   #4
galen
Member
 
Registered: Sep 2003
Location: Halifax, Nova Scotia, Canada
Distribution: MX, Xubuntu, Zorin. BOYCOTTING: Vector, Beatrix, BLAG, Slackware. Life banned from: Facebook, Yahoo!
Posts: 190

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 06-26-2019, 12:11 PM   #5
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,371

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
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.

Last edited by colorpurple21859; 06-26-2019 at 12:12 PM.
 
Old 06-28-2019, 07:10 AM   #6
galen
Member
 
Registered: Sep 2003
Location: Halifax, Nova Scotia, Canada
Distribution: MX, Xubuntu, Zorin. BOYCOTTING: Vector, Beatrix, BLAG, Slackware. Life banned from: Facebook, Yahoo!
Posts: 190

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
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
 
Old 06-28-2019, 09:35 AM   #7
beachboy2
Senior Member
 
Registered: Jan 2007
Location: Wild West Wales, UK
Distribution: Linux Mint 21 MATE, EndeavourOS, antiX, MX Linux
Posts: 3,987
Blog Entries: 33

Rep: Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470Reputation: 1470
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).
 
1 members found this post helpful.
Old 06-28-2019, 01:33 PM   #8
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
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?).
 
Old 06-28-2019, 05:00 PM   #9
galen
Member
 
Registered: Sep 2003
Location: Halifax, Nova Scotia, Canada
Distribution: MX, Xubuntu, Zorin. BOYCOTTING: Vector, Beatrix, BLAG, Slackware. Life banned from: Facebook, Yahoo!
Posts: 190

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by 273 View Post
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
 
Old 06-28-2019, 05:04 PM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
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.
 
Old 06-28-2019, 05:05 PM   #11
galen
Member
 
Registered: Sep 2003
Location: Halifax, Nova Scotia, Canada
Distribution: MX, Xubuntu, Zorin. BOYCOTTING: Vector, Beatrix, BLAG, Slackware. Life banned from: Facebook, Yahoo!
Posts: 190

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by beachboy2 View Post
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
 
Old 06-29-2019, 02:07 PM   #12
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,409

Rep: Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338Reputation: 2338
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.
 
Old 06-29-2019, 04:41 PM   #13
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,371

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
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.
 
Old 06-30-2019, 03:38 PM   #14
galen
Member
 
Registered: Sep 2003
Location: Halifax, Nova Scotia, Canada
Distribution: MX, Xubuntu, Zorin. BOYCOTTING: Vector, Beatrix, BLAG, Slackware. Life banned from: Facebook, Yahoo!
Posts: 190

Original Poster
Blog Entries: 1

Rep: Reputation: Disabled
Quote:
Originally Posted by colorpurple21859 View Post
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
 
Old 06-30-2019, 03:53 PM   #15
colorpurple21859
LQ Veteran
 
Registered: Jan 2008
Location: florida panhandle
Distribution: Slackware Debian, Fedora, others
Posts: 7,371

Rep: Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593Reputation: 1593
was the partition flagged as lba?
nevermind seen where you already tried that.

Last edited by colorpurple21859; 06-30-2019 at 03:54 PM.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trouble formatting USB stick, although can read-access Steve W Linux - Hardware 1 02-20-2017 06:02 AM
Formatting a USB stick singh016 Linux - Newbie 6 06-28-2014 01:08 PM
[SOLVED] Formatting an 8GB usb stick mike11 Linux - Newbie 2 10-24-2011 09:39 PM
Formatting a USB memory stick Chriscrof Linux - Newbie 4 05-01-2010 03:31 AM
Formatting my USB stick with ext3 makes stuff crash Khang Linux - Hardware 0 02-20-2005 07:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 02:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration