Personal computing discussed

Moderators: morphine, Steel

 
FireGryphon
Gold subscriber
Darth Gerbil
Topic Author
Posts: 7681
Joined: Sat Apr 24, 2004 7:53 pm
Location: the abyss into which you gaze

Format ext4 from Windows

Sat May 18, 2019 8:30 pm

I purchased a micro SDHC card that came with a Linux OS on it. I want to write a different image to the card. The problem is that I'm using Windows, so none of the imaging programs can read the card. Is there a reliable and safe Windows program that can read/write/format/etc. an ext4 partition from Windows?
Sheep Rustlers in the sky! <S> Slapt | <S> FUI | Air Warrior II/III
 
chuckula
Gold subscriber
Minister of Gerbil Affairs
Posts: 2072
Joined: Wed Jan 23, 2008 9:18 pm
Location: Probably where I don't belong.

Re: Format ext4 from Windows

Sat May 18, 2019 8:44 pm

Formatting (more accurately, partitioning and then formatting) is easy. Just use the default Windows partitioning tool to wipe out the partition table and reformat.

Getting the data off of the card (if you care to do so) is going to be harder although there are tools out there to do it. I don't know what the Windows equivalent of dd is [if there is one] or if you need a third-party utility.
4770K @ 4.7 GHz; 32GB DDR3-2133; Officially RX-560... that's right AMD you shills!; 512GB 840 Pro (2x); Fractal Define XL-R2; NZXT Kraken-X60
--Many thanks to the TR Forum for advice in getting it built.
 
FireGryphon
Gold subscriber
Darth Gerbil
Topic Author
Posts: 7681
Joined: Sat Apr 24, 2004 7:53 pm
Location: the abyss into which you gaze

Re: Format ext4 from Windows

Sat May 18, 2019 8:46 pm

If I try to partition the card from Explorer or Computer Management I can make a partition that is 30 MB maximum. The card, though, is an 8 GB card. I need a formatting tool that can see the ext4 partition and work with it.
Sheep Rustlers in the sky! <S> Slapt | <S> FUI | Air Warrior II/III
 
chuckula
Gold subscriber
Minister of Gerbil Affairs
Posts: 2072
Joined: Wed Jan 23, 2008 9:18 pm
Location: Probably where I don't belong.

Re: Format ext4 from Windows

Sat May 18, 2019 8:52 pm

FireGryphon wrote:
If I try to partition the card from Explorer or Computer Management I can make a partition that is 30 MB maximum. The card, though, is an 8 GB card. I need a formatting tool that can see the ext4 partition and work with it.


Hrrmmm.. well I make no claims as to how well it works, but this tool appears to be free and expressly mentions managing EXT4 from Windows: https://www.disk-partition.com/windows- ... ndows.html

Hopefully that will help.
4770K @ 4.7 GHz; 32GB DDR3-2133; Officially RX-560... that's right AMD you shills!; 512GB 840 Pro (2x); Fractal Define XL-R2; NZXT Kraken-X60
--Many thanks to the TR Forum for advice in getting it built.
 
DragonDaddyBear
Silver subscriber
Gerbil Elite
Posts: 919
Joined: Fri Jan 30, 2009 8:01 am

Re: Format ext4 from Windows

Sat May 18, 2019 9:09 pm

Every time I've had an ISO to put on a card over you used RuFS.
 
FireGryphon
Gold subscriber
Darth Gerbil
Topic Author
Posts: 7681
Joined: Sat Apr 24, 2004 7:53 pm
Location: the abyss into which you gaze

Re: Format ext4 from Windows

Sun May 19, 2019 9:20 am

Rufus is for imaging the disk, but it won't read my card, which is unreadable in Windows due to its extant file system.

I'm hesitant to download a utility without other people telling me they've used it, though there seem to be a few available. I'm afraid the only way to solve this is to download Linux and just boot into an actual OS.
Sheep Rustlers in the sky! <S> Slapt | <S> FUI | Air Warrior II/III
 
SecretSquirrel
Minister of Gerbil Affairs
Posts: 2622
Joined: Tue Jan 01, 2002 7:00 pm
Location: North DFW suburb...
Contact:

Re: Format ext4 from Windows

Sun May 19, 2019 9:32 am

Windows may not be able to read the filesystem, but it should be able to read the partition table. It should show an approximately 8GB partition of "unkown filesystem", or something like that. I suppose it could be having problems with a GPT style partition table.

Ignore the fact that this article is about Windows installation and skip down to the "Wipe a drive and convert to MBR": https://www.thewindowsclub.com/windows- ... -this-disk

Just make sure you select your 8GB microSD card card and not your hard drive.

--SS
 
Ari Atari
Gold subscriber
Gerbil First Class
Posts: 145
Joined: Wed Jan 26, 2011 3:00 pm
Location: Earth

Re: Format ext4 from Windows

Sun May 19, 2019 10:58 am

Ah yes, I was having a similar problem and DISKPART was the way to go. I don't see why the gui version won't even try to simply nuke the partition table if it doesn't know what the partitions are. It's obviously possible because DISKPART will do it.
 
Wirko
Gold subscriber
Gerbil First Class
Posts: 190
Joined: Fri Jun 15, 2007 4:38 am
Location: Central Europe

Re: Format ext4 from Windows

Sun May 19, 2019 11:35 am

Do you need access to the files inside an image or do you just need to work with images?

I've used Win32 Disk Imager for writing Raspberry Pi images to SD cards. It can write, read or verify an image of a whole disk/card - the partition table and the partition(s), and that's all it can do. It knows nothing about individual partitions or individual files. It can't write or read an image of a single partition - that's what Rufus is for.

Edit: But neither of those two tools can read or write individual files, regardless of file system.

https://raspberry-projects.com/pi/pi-operating-systems/win32diskimager
 
just brew it!
Gold subscriber
Administrator
Posts: 52791
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Format ext4 from Windows

Sun May 19, 2019 1:19 pm

You could boot from a Linux live image or Ultimate Boot CD and use that to wipe and re-image it.
Nostalgia isn't what it used to be.
 
Firestarter
Gerbil Elite
Posts: 773
Joined: Sun Apr 25, 2004 11:12 am

Re: Format ext4 from Windows

Sun May 19, 2019 1:37 pm

just brew it! wrote:
You could boot from a Linux live image or Ultimate Boot CD and use that to wipe and re-image it.

yeah I was going to suggest this. Gparted Live on a USB-stick worked great for me (and quick to download/write), or use literally any live-boot linux
 
MOSFET
Gold subscriber
Gerbil XP
Posts: 353
Joined: Fri Aug 08, 2014 12:42 am

Re: Format ext4 from Windows

Sun May 19, 2019 2:01 pm

Rufus is able to restore full size of external media. You shouldn't even have to read the FAQ, which is about 500 pages of options I never knew existed, with a bit of attention to the settings used.
Be careful on inserting this (or any G34 chip) into the socket. Once you pull that restraining lever, it is either a good install or a piece of silicon jewelry.
 
FireGryphon
Gold subscriber
Darth Gerbil
Topic Author
Posts: 7681
Joined: Sat Apr 24, 2004 7:53 pm
Location: the abyss into which you gaze

Re: Format ext4 from Windows

Sun May 19, 2019 9:39 pm

Rufus can’t see the card as any more than 30 MB. In fact, I booted into live versions of Slax and Lububtu and neither of them see the card. I have a sneaking suspicion that I’m missing something, but I don’t know what it is. Might have to return the card.
Sheep Rustlers in the sky! <S> Slapt | <S> FUI | Air Warrior II/III
 
DrCR
Gerbil Team Leader
Posts: 261
Joined: Tue May 10, 2005 7:18 am

Re: Format ext4 from Windows

Sun May 19, 2019 9:54 pm

FireGryphon wrote:
I booted into live versions of Slax and Lububtu and neither of them see the card

Even fdisk -l does not show it?
 
FireGryphon
Gold subscriber
Darth Gerbil
Topic Author
Posts: 7681
Joined: Sat Apr 24, 2004 7:53 pm
Location: the abyss into which you gaze

Re: Format ext4 from Windows

Mon May 20, 2019 1:54 am

DrCR wrote:
FireGryphon wrote:
I booted into live versions of Slax and Lububtu and neither of them see the card

Even fdisk -l does not show it?


I looked in the file explorer programs. I haven’t used the command line in so long... but I’ll check.
Sheep Rustlers in the sky! <S> Slapt | <S> FUI | Air Warrior II/III
 
SecretSquirrel
Minister of Gerbil Affairs
Posts: 2622
Joined: Tue Jan 01, 2002 7:00 pm
Location: North DFW suburb...
Contact:

Re: Format ext4 from Windows

Mon May 20, 2019 1:43 pm

FireGryphon wrote:
DrCR wrote:
FireGryphon wrote:
I booted into live versions of Slax and Lububtu and neither of them see the card

Even fdisk -l does not show it?


I looked in the file explorer programs. I haven’t used the command line in so long... but I’ll check.


They are likely just showing you the vfat formatted partition used for UEFI boot. You'll need to use a partition editor to actually see what it is partition like. If you want a GUI version, something like gparted. If you are in linux and just want to wipe the drive:

dd if=/dev/zero of=<device> bs=1MB


Be very careful with the device specification. Specify the wrong one and you will trash your system, probably permanently. You can also add "count=1024" to limit it to the first 1GB of the card, actually less probably, as the partition tables are up front. If you don't specify the count, it will run until it gets an error when it has written to the entire card. When it finishes, it will give a summary of how much was written. If you let it run until it gets a write error, you can tell what size the card actually is -- there was rash of counterfeit cards a while back where smaller cards were being programmed to lie about their size. Don't know if that is still a huge problem, but a sanity check is always good. Note that it will take a good while to wipe the card.
 
SuperSpy
Gold subscriber
Minister of Gerbil Affairs
Posts: 2397
Joined: Thu Sep 12, 2002 9:34 pm
Location: TR Forums

Re: Format ext4 from Windows

Mon May 20, 2019 1:48 pm

Disk management in Windows should be able to see the partitions and destroy them.

Failing that, issuing the 'clean' command in diskpart to that device should erase the partition table and allow you to do anything you want to it.
Desktop: i7-4790K @4.8 GHz | 32 GB | EVGA Gefore 1060 | Windows 10 x64
Laptop: MacBook Pro 2017 2.9GHz | 16 GB | Radeon Pro 560
 
cphite
Graphmaster Gerbil
Posts: 1020
Joined: Thu Apr 29, 2010 9:28 am

Re: Format ext4 from Windows

Mon May 20, 2019 4:20 pm

SuperSpy wrote:
Disk management in Windows should be able to see the partitions and destroy them.

Failing that, issuing the 'clean' command in diskpart to that device should erase the partition table and allow you to do anything you want to it.


Yeah, disk management in Windows should...

Thing is, I've had several USB sticks that I've used as boot devices for Linux that have become foobar for Windows... sometimes they show an error saying the volume is damaged, but other times Windows just sees them as a much smaller drive - as in an 8GB stick showing up as a couple of megs volume for example. And even attempting a full format via Windows doesn't seem to work.

It's easy enough to just pop 'em into my Linux desktop and do a format there - as Linux has no problem seeing the full volume size. So I haven't bothered using any third party tools in Windows to address these... but it's weird. It's happened with FAT and NTFS formats.

I don't know if it's an issue with Windows, or something UNetbootin is doing (I most commonly use this to make my boot sticks) or something that Linux is doing once the stick is used. I really haven't found a pattern yet (not that I've looked all that hard...)
 
Captain Ned
Gold subscriber
Global Moderator
Posts: 27705
Joined: Wed Jan 16, 2002 7:00 pm
Location: Vermont, USA

Re: Format ext4 from Windows

Mon May 20, 2019 5:18 pm

The HP USB Disk Storage Format Tool has yet to fail me.
Humans sleep soundly in their beds because rough cats stand ready in the night to visit violence on those who would do us harm.
 
anotherengineer
Gerbil Jedi
Posts: 1648
Joined: Fri Sep 25, 2009 1:53 pm
Location: Northern, ON Canada, Yes I know, Up in the sticks

Re: Format ext4 from Windows

Mon May 20, 2019 6:17 pm

FireGryphon wrote:
I purchased a micro SDHC card that came with a Linux OS on it. I want to write a different image to the card. The problem is that I'm using Windows, so none of the imaging programs can read the card. Is there a reliable and safe Windows program that can read/write/format/etc. an ext4 partition from Windows?


hmm do you care about the data or the ext4?

2 other things that come to mind,
-is if you have an msi (recent) mobo, enter the bios and see if it can see the sd card, new msi bios can secure erase, that may be possible
other
-https://www.microsoft.com/en-ca/software-download/windows10
if you download the tool and select your sd card, it should wipe and format it to fat32 or ntfs, then you can just cancel the windows install to it.

I have also had luck with the tools on UBCD
https://www.ultimatebootcd.com/

good luck
Life doesn't change after marriage, it changes after children!
 
The Egg
Gold subscriber
Minister of Gerbil Affairs
Posts: 2696
Joined: Sun Apr 06, 2008 4:46 pm

Re: Format ext4 from Windows

Wed May 22, 2019 1:01 pm

It's absurd that we still have these sorts of file system compatibility and drive formatting issues in a modern OS.
  • EXT is widely used in server environments and consumer devices. It's an open source file system with no licensing issues. That support isn't baked-in is inexcusable.
  • USB and SD Flash drives are now (and for the foreseeable future) the most commonly used type of removable drives. Simple procedures such as making them bootable, copying images, and erasing them shouldn't require downloading little-known 3rd party software from shady sources, or performing command-line force-erasures well beyond the ability of the average user (Diskpart). Even worse, the UI options are completely unintuitive, and give no indication as to why they're failing, likely causing most users to assume the drive has failed and toss out perfectly good drives en masse.
  • While we're at it, at this point there also ought to be a baked-in one-click solution to create an image of the system drive to an external/removable, and separately, all user-folder personal files (including those copied to the desktop). It ought to take about 10-20MB. Certainly more useful than any of the included Windows Store crap, or Candy Crush.
 
Waco
Gold subscriber
Minister of Gerbil Affairs
Posts: 2935
Joined: Tue Jan 20, 2009 4:14 pm
Location: Los Alamos, NM

Re: Format ext4 from Windows

Wed May 22, 2019 1:09 pm

I've never had to use third-party tools, but you do need to be familiar with diskpart and I've definitely had to unplug/replug drives that have non-Windows filesystem layouts on them to get them to refresh the volumes after "fixing" them with diskpart.

It is amazing how much of a pain in the ass this still is.
Desktop: Z170A | 6700K @ 4.4 | 32 GB | Alphacool Eisblock Radeon VII | Heatkiller R3 | Samsung 4K 40" | 1 TB NVME + 2 TB SATA + LSI (128x8) RAID 0
NAS: 1950X | Designare EX | 32 GB ECC | 7x8 TB RAIDZ2 | 8x2 TB RAID10 | FreeNAS | ZFS | LSI SAS
 
DragonDaddyBear
Silver subscriber
Gerbil Elite
Posts: 919
Joined: Fri Jan 30, 2009 8:01 am

Re: Format ext4 from Windows

Wed May 22, 2019 1:33 pm

I just had a thought. What if you did a VM with pass through?
 
mikepers
Gold subscriber
Gerbil
Posts: 28
Joined: Fri Dec 16, 2011 4:47 pm

Re: Format ext4 from Windows

Wed May 22, 2019 2:17 pm

try Powershell as admin

run "diskpart"

list disk
select disk x
list partition
select partition x
delete partition

edit: Just realized SuperSpy already mentioned diskpart. I had not noticed the clean option before but that sounds even easier also fixed typo
Last edited by mikepers on Thu May 23, 2019 10:19 am, edited 2 times in total.
 
curtisb
Gerbil XP
Posts: 429
Joined: Tue Mar 30, 2010 11:27 pm
Location: Oklahoma

Re: Format ext4 from Windows

Wed May 22, 2019 5:32 pm

You can do it even easier with diskpart. Open an elevated Command Prompt and run the following:

list disk
select disk #
clean
exit


Just make sure you select the right disk number. You should be able to tell by the size. That will clear off any partitions/volumes on the SD card. Then you can do everything else in the Disk Management GUI.

EDIT: Added a screenshot showing an example with an 8GB flash drive.
Image
ASUS MAXIMUS VIII HERO | Intel Core i7-6700 | Asus STRIX GTX 970 4GB | 4 x Corsair LPX 8GB | 2 x Crucial MX200 500GB | 2 x Hitachi Deskstar 4TB | Phanteks Eclipse | Seasonic X-850 | Dell UP2516D
 
Wirko
Gold subscriber
Gerbil First Class
Posts: 190
Joined: Fri Jun 15, 2007 4:38 am
Location: Central Europe

Re: Format ext4 from Windows

Wed May 22, 2019 5:56 pm

cphite wrote:
SuperSpy wrote:
Disk management in Windows should be able to see the partitions and destroy them.

Failing that, issuing the 'clean' command in diskpart to that device should erase the partition table and allow you to do anything you want to it.


Yeah, disk management in Windows should...

Thing is, I've had several USB sticks that I've used as boot devices for Linux that have become foobar for Windows... sometimes they show an error saying the volume is damaged, but other times Windows just sees them as a much smaller drive - as in an 8GB stick showing up as a couple of megs volume for example. And even attempting a full format via Windows doesn't seem to work.


Is GPT disk structure able to confuse Disk management in Windows (diskmgmt.msc) so thoroughly that it can't even detect the media size properly? I only have a boot SD card for Raspberry Pi at hand, which is MBR partitioned, and it displays everything as expected. Partitions are recognized and can be deleted, despite the unknown file system, which is ext4.
 
The Egg
Gold subscriber
Minister of Gerbil Affairs
Posts: 2696
Joined: Sun Apr 06, 2008 4:46 pm

Re: Format ext4 from Windows

Wed May 22, 2019 6:08 pm

^ Forcing the user to do that is still completely unacceptable. 30+ years ago maybe, but not in 2019 just to format a flippin flash drive. Try talking a family member or non-IT coworker through that over the phone. Now imagine one of the attached drives contains critical data.
 
just brew it!
Gold subscriber
Administrator
Posts: 52791
Joined: Tue Aug 20, 2002 10:51 pm
Location: Somewhere, having a beer

Re: Format ext4 from Windows

Wed May 22, 2019 6:30 pm

Windows has supported GPT for a while. Not sure why it is freaking out over this one.
Nostalgia isn't what it used to be.
 
curtisb
Gerbil XP
Posts: 429
Joined: Tue Mar 30, 2010 11:27 pm
Location: Oklahoma

Re: Format ext4 from Windows

Wed May 22, 2019 6:41 pm

The Egg wrote:
^ Forcing the user to do that is still completely unacceptable. 30+ years ago maybe, but not in 2019 just to format a flippin flash drive. Try talking a family member or non-IT coworker through that over the phone. Now imagine one of the attached drives contains critical data.

While I agree with you, it's also ridiculous for an SD card to ship formatted with something other than FAT/FAT32. Both formats have been supported by literally any device/OS that accesses a drive for over two decades now.
ASUS MAXIMUS VIII HERO | Intel Core i7-6700 | Asus STRIX GTX 970 4GB | 4 x Corsair LPX 8GB | 2 x Crucial MX200 500GB | 2 x Hitachi Deskstar 4TB | Phanteks Eclipse | Seasonic X-850 | Dell UP2516D
 
Waco
Gold subscriber
Minister of Gerbil Affairs
Posts: 2935
Joined: Tue Jan 20, 2009 4:14 pm
Location: Los Alamos, NM

Re: Format ext4 from Windows

Wed May 22, 2019 6:51 pm

curtisb wrote:
While I agree with you, it's also ridiculous for an SD card to ship formatted with something other than FAT/FAT32. Both formats have been supported by literally any device/OS that accesses a drive for over two decades now.

exFAT! FAT/FAT32 are dead and shouldn't be used any more. :)
Desktop: Z170A | 6700K @ 4.4 | 32 GB | Alphacool Eisblock Radeon VII | Heatkiller R3 | Samsung 4K 40" | 1 TB NVME + 2 TB SATA + LSI (128x8) RAID 0
NAS: 1950X | Designare EX | 32 GB ECC | 7x8 TB RAIDZ2 | 8x2 TB RAID10 | FreeNAS | ZFS | LSI SAS

Who is online

Users browsing this forum: No registered users and 2 guests