• Re: need a dd copy line to zero fill this thumb drive

    From bilsch01@21:1/5 to All on Tue Oct 10 18:38:08 2023
    On 10/10/2023 6:27 PM, bilsch01 wrote:
    I have a 8GB thumb drive that used to be a ubuntu installer. In the
    middle of the space there is some tiny system partition - for some
    reason. I want to wipe the whole drive and start out new. Windows wont
    format it. GPARTED won't delete the partitions. I don't care about what
    this drive is all about.

    Can somebody please tell me a dd copy command line that will zero-fill
    this drive?

    Thanks for your help.   Bill S.

    Windows wont format the drive because it says it's read only, however
    DISKPART tells me it's not read only. Can't I just zero fill it and
    start over?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Easter@21:1/5 to All on Tue Oct 10 18:59:16 2023
    bilsch01 wrote:
    Windows wont format the drive because it says it's read only, however DISKPART tells me it's not read only. Can't I just zero fill it and
    start over?

    Rufus 'ordinary' (quick, not quick, and check for bad blocks - but not
    zero) format will probably (highly likely) format it. If I want to zero
    you could use diskpart after rufus formats it.

    Personally, I would just Rufus quick, not not-quick, not check bad
    blocks and not zero.

    Rufus is Win, small, free, and doesn't need install. It is also VERY
    good Win tool for writing linux .iso/s to USB more than one way; hybrid
    or dd-style. And can even do a form of persistence for some .iso/s.

    --
    Mike Easter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Easter@21:1/5 to Mike Easter on Tue Oct 10 19:14:58 2023
    Mike Easter wrote:
    Rufus is Win, small, free, and doesn't need install.  It is also VERY
    good Win tool for writing linux .iso/s to USB more than one way; hybrid
    or dd-style.  And can even do a form of persistence for some .iso/s.

    Oops I meant to put a link after that.

    https://rufus.ie/en/

    I use an older v. than current on W7

    The last version of Rufus that runs on Windows 7 is version 3.22,

    Or if your Win is /older/ than that:

    The last version of Rufus that runs on Windows XP is version 2.18,



    --
    Mike Easter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bilsch01@21:1/5 to All on Tue Oct 10 18:27:50 2023
    I have a 8GB thumb drive that used to be a ubuntu installer. In the
    middle of the space there is some tiny system partition - for some
    reason. I want to wipe the whole drive and start out new. Windows wont
    format it. GPARTED won't delete the partitions. I don't care about what
    this drive is all about.

    Can somebody please tell me a dd copy command line that will zero-fill
    this drive?

    Thanks for your help. Bill S.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to All on Wed Oct 11 00:28:57 2023
    On 10/10/2023 9:38 PM, bilsch01 wrote:
    On 10/10/2023 6:27 PM, bilsch01 wrote:
    I have a 8GB thumb drive that used to be a ubuntu installer. In the middle of the space there is some tiny system partition - for some reason. I want to wipe the whole drive and start out new. Windows wont format it. GPARTED won't delete the
    partitions. I don't care about what this drive is all about.

    Can somebody please tell me a dd copy command line that will zero-fill this drive?

    Thanks for your help.   Bill S.

    Windows wont format the drive because it says it's read only, however DISKPART tells me it's not read only. Can't I just zero fill it and start over?

    It's possible Windows has a bit more overhead for disk
    management, than Linux. In the sense of this in Windows:

    Administrator window

    diskpart.exe
    list disk
    select disk 1 # assumes disk 0 is boot drive, disk 1 is USB stick
    detail disk # Dump detail of device at whole-disk level

    Sandisk Cruise <=== device model number
    Status : Online
    ...
    Current Read-only State : No <=== examine this variable (logical device state)
    Read-only : No <=== this might be the write protect switch, if present

    attributes disk clear readonly <=== Change the State from Yes to No
    detail disk <=== Verify the attempt succeeded
    exit

    More examples here.
    Sites like this, write these articles, as part of their advertising campaign.

    https://www.diskpart.com/articles/usb-drive-read-only-7201.html

    *******

    On Linux, these are the first commands you want to reach for.

    I use gdisk first, because it tells me whether I need to use fdisk or not.

    sudo gdisk /dev/sdb # This is the new utility. Advantage of this one
    # is that it can tell you whether the device is MSDOS
    # or GPT. If it is GPT, there is a cleaning procedure.

    sudo fdisk /dev/sdb # Assumes sda is boot drive, sdb is USB stick

    When you enter gdisk, it has four status lines at the top, for the named device.
    GPT is one of the fields there.

    If the device is GPT partitioned, it has an MBR plus primary GPT table (near origin)
    plus secondary GPT table (near end).

    If the device is MSDOS partitioned, it should only have the MBR at sector 0 having data.

    Sometimes you have to remove the GPT tables anyway.

    Enter the letter "x" as the command, which stands for Expert Mode.
    Enter the letter "z" as the command, which zaps GPT info. You can remove the MBR too.
    I can't remember if "w" and "q" are needed at this point, or only "q" is enough.

    You can re-enter the utility, and double-check whether the command worked. Perhaps pulling the stick out, and plugging it back in, will cause
    the machine to re-evaluate the metadata, before you do another sudo gdisk /dev/sdb

    *******

    Windows will not always be happy at this point.

    If you use

    sudo fdisk /dev/sdb

    you can create an MBR and add one partition.

    If you add one partition, make it a portion of the drive, not the whole drive. On a 16GB stick, I would create an 8GB partition, just ONE partition.
    While Windows latest, claims to support multiple partitions on USB sticks,
    I'm not convinced this is a safe assumption at present.

    Doing a "w" and a "q" at this point, writes the new info into sector 0 of the USB stick.

    Just because you set the new partition to NTFS 0x07, does not mean it is formatted.
    You can format it in GParted if you want. Usually, the Windows utility you use, will "sniff" the fully functional NTFS partition you offer, and... just overwrite it.
    Don't take it personally when this happens. It's all part of the ceremonies.

    sudo gparted /dev/sdb # gparted is a *different* utility than gdisk
    # We are formatting, solely to keep some stupid status subroutine happy.
    # Otherwise, this is a waste of time, if the SW worked right.

    *******

    In general, for cheesy TLC USB sticks, it is NOT advised to do the following. This is a hardware issue, and nothing to do with the Linux we are using
    at the moment.

    sudo dd if=/dev/zero of=/dev/sdb bs=8192 # This will thoroughly erase a rotating HDD.
    # Do not use this on USB flash sticks. The
    # TLC ones are quite write sensitive.

    Say we had researched the layout of GPT disks, and we knew precisely where the metadata was.

    First, we check our understanding of the size syntax.

    dd if=/dev/zero bs=1M count=3 | wc -c # Count the characters on stdout, to verify write amount

    dd if=/dev/zero bs=1M count=3 | wc -c
    3+0 records in
    3+0 records out
    3145728
    3145728 bytes (3.1 MB, 3.0 MiB)... <=== 3*1024*1024

    To actually overwrite the first 3MB, we'd do

    sudo dd if=/dev/zero of=/dev/sdb bs=1M count=3 # Assumes /dev/sdb is the USB stick

    If instead, I do this, the entire USB flash device is erased. Use a bs of at least 16384
    or there will be additional (unnecessary) wear on the USB flash. 16384 is a typical page
    size on the flash.

    sudo dd if=/dev/zero of=/dev/sdb bs=16384 # This writes until device is full
    # The status will tell you "no space left on device"
    # This is a last resort for TLC USB flash sticks.
    # It can be pretty slow.

    *******

    Windows has a third-party dd utility.
    The namespace is different.

    In administrator window,

    dd.exe --list # This helps you pick names for the target device.

    For more details:

    http://www.chrysocome.net/dd

    http://www.chrysocome.net/downloads/dd-0.6beta3.zip

    This Windows utility has its own share of quirks.

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Marco Moock@21:1/5 to All on Wed Oct 11 08:30:58 2023
    Am 10.10.2023 um 18:27:50 Uhr schrieb bilsch01:

    Can somebody please tell me a dd copy command line that will
    zero-fill this drive?

    sudo dd=if=/dev/zero of=/dev/sdX bs=4M

    Replace X with the driver letter, use lsblk to get it.
    Make sure no partition of the drive is being mounted.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bilsch01@21:1/5 to Marco Moock on Wed Oct 11 12:03:41 2023
    On 10/10/2023 11:30 PM, Marco Moock wrote:
    Am 10.10.2023 um 18:27:50 Uhr schrieb bilsch01:

    Can somebody please tell me a dd copy command line that will
    zero-fill this drive?

    sudo dd=if=/dev/zero of=/dev/sdX bs=4M

    Replace X with the driver letter, use lsblk to get it.
    Make sure no partition of the drive is being mounted.
    Thanks. Zero fill worked fine.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bilsch01@21:1/5 to Mike Easter on Wed Oct 11 13:04:23 2023
    On 10/10/2023 6:59 PM, Mike Easter wrote:
    bilsch01 wrote:
    Windows wont format the drive because it says it's read only, however
    DISKPART tells me it's not read only. Can't I just zero fill it and
    start over?

    Rufus 'ordinary' (quick, not quick, and check for bad blocks - but not
    zero) format will probably (highly likely) format it.  If I want to zero
    you could use diskpart after rufus formats it.

    Personally, I would just Rufus quick, not not-quick, not check bad
    blocks and not zero.

    Rufus is Win, small, free, and doesn't need install.  It is also VERY
    good Win tool for writing linux .iso/s to USB more than one way; hybrid
    or dd-style.  And can even do a form of persistence for some .iso/s.

    I had looked at Rufus to start with, however it seemed Rufus didn't like
    the flash drive, so I decided to zero fill it - which I just did. Next I
    used current version of Rufus off of the web to make the drive a
    Ubuntu 22.04.03 installer using the downloaded Ubuntu iso. That worked,
    but Rufus warned that maybe the version of Grub (that Rufus would use)
    might not be absolutely compatible with the installer. I went ahead
    anyway. The drive boots the 'Try Ubuntu' option fine. But maybe a system installed with the drive might have a Grub problem. I decided I won't
    use the installer to install right now.

    The reason I'm doing all this is I want to delete the SWAP partition I
    put on my HDD when I installed my 20.04 system, and I heard that current version of Ubuntu uses a SWAP file instead. There is a SWAP file even on
    my 20.04 system, but I have concerns. I wrote a post on comp.sys.ibm.pc.hardware.storage
    about that.

    Thanks for your answer about Rufus. Actually, the reason I know about
    Rufus is because you told me about it years ago on usenet.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Easter@21:1/5 to All on Wed Oct 11 14:38:14 2023
    bilsch01 wrote:
    Mike Easter wrote:
    bilsch01 wrote:
    Windows wont format the drive because it says it's read only, however
    DISKPART tells me it's not read only. Can't I just zero fill it and
    start over?

    Personally, I would just Rufus quick, not not-quick, not check bad
    blocks and not zero.

    I had looked at Rufus to start with, however it seemed Rufus didn't like
    the flash drive, so I decided to zero fill it - which I just did.

    Yes; occsly I've had to go 'outside' Rufus for a problem stick which has included w/ linux and zero. Not very often. It seems like the last
    time I zero/ed a USB was using an 'ancient' Hiren's classic which has
    tools from XP, linux, and dos on it. I don't recall what I used.

    Next I used current version of Rufus off of the web to make the drive
    a Ubuntu 22.04.03 installer using the downloaded Ubuntu iso. That
    worked, but Rufus warned that maybe the version of Grub (that Rufus
    would use) might not be absolutely compatible with the installer.
    I'm not familiar w/ such an experience. It interests me enough that I
    think I'll dust off the laptop that has W10 on it which is the only
    thing I have that can run the current Rufus 4.2 and see what happens if
    I write the Ub 22.04.03 with it. The newest Rufus is '23 Jul and that
    Ub is '23 Aug. Usually if Rufus 'alerts' on something, it is about the syslinux and it has a 'stockpile' of versions online that it can fetch
    for itself if needed.

    I went ahead anyway. The drive boots the 'Try Ubuntu' option fine.
    But maybe a system installed with the drive might have a Grub
    problem. I decided I won't use the installer to install right now.

    The reason I'm doing all this is I want to delete the SWAP partition
    I put on my HDD when I installed my 20.04 system, and I heard that
    current version of Ubuntu uses a SWAP file instead. There is a SWAP
    file even on my 20.04 system, but I have concerns. I wrote a post on comp.sys.ibm.pc.hardware.storage about that.

    I think the user/installer should decide how he wants to handle the swap himself.

    I always 'prepare' my install place myself w/ GPartEd before I start the installer. In the past I was uncertain about how the installer was
    going to 'present' things to me, so by just using GPartEd and setting
    things up for myself, I knew better what was going on.

    Thanks for your answer about Rufus. Actually, the reason I know about
    Rufus is because you told me about it years ago on usenet.


    --
    Mike Easter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Easter@21:1/5 to Mike Easter on Wed Oct 11 19:28:59 2023
    Mike Easter wrote:
    bilsch01 wrote:
    Mike Easter wrote:

    Next I used current version of Rufus off of the web to make the drive
    a Ubuntu 22.04.03 installer using the downloaded Ubuntu iso. That
    worked, but Rufus warned that maybe the version of Grub (that Rufus
    would use) might not be absolutely compatible with the installer.

    I'm not familiar w/ such an experience. It interests me enough that
    I think I'll dust off the laptop that has W10 on it which is the only
    thing I have that can run the current Rufus 4.2 and see what happens
    if I write the Ub 22.04.03 with it. The newest Rufus is '23 Jul and
    that Ub is '23 Aug. Usually if Rufus 'alerts' on something, it is
    about the syslinux and it has a 'stockpile' of versions online that
    it can fetch for itself if needed.

    I did all that; used the W10 LT + Rufus 4.2 + Ub 22.04.3 and you are
    correct the alert is about grub, not syslinux, but I would consider that
    alert 'negligible' as it is about the 'language' difference between grub
    2.06 and the Ub v. of grub 2.06-2ubuntu7.2. Rufus even offers to go
    online and see if it can find access to dl the slightly differently
    named grub 2.06.

    The other thing I unhappily discovered in the logistics process is that
    the Ub 22.04.3 is SO FAT that it can't be written to a fat32 USB. That
    is ridiculous, because the most common USB I use is fat32 such as a
    Ventoy stick 'full of' linux .iso/s. If distro/s start making the .iso
    so big that it can't be written to a fat32 USB it is going to cause trouble.

    ... which reminds me of something else. I wish more distro dev/s would
    do like (somebody I forget) and provide the option of a 'minimal' distro
    of a conventional desktop, that is w/o all of the 'extras' of office
    suite and all that. Call me a distro hopper of whatever term you like,
    but I'm interested in seeing the newest version of a distro and some of
    its DEs as a live boot, but i'm NOT interested in it being bloated w/
    all of the apps I can possibly ever use. It just takes up time to dl
    and hashcheck and authenticate and takes up storage space and takes up
    space on the Ventoy stick and takes up time to boot. And it uses
    'unnecessary' resources everywhere.

    Too big to write to fat32 storage!? Give me a break Ubuntu. Trim the bloat/fat.


    --
    Mike Easter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From azigni@21:1/5 to Mike Easter on Thu Oct 12 04:07:49 2023
    On Wed, 11 Oct 2023 20:31:46 -0700, Mike Easter wrote:

    So is the beta for 23.10

    ubuntu-23.10-beta-desktop-amd64.iso (4,912MB)

    It is bad enough that .iso/s that are supposed to have 'extras' have
    become 'monstrous'

    edubuntu-23.10-beta-desktop-amd64.iso (5,699MB)

    It's only going to get bigger as they move on to flatpak iso's

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Easter@21:1/5 to Mike Easter on Wed Oct 11 20:31:46 2023
    Mike Easter wrote:
    the Ub 22.04.3 is SO FAT that it can't be written to a fat32 USB.

    So is the beta for 23.10

    ubuntu-23.10-beta-desktop-amd64.iso (4,912MB)

    It is bad enough that .iso/s that are supposed to have 'extras' have
    become 'monstrous'

    edubuntu-23.10-beta-desktop-amd64.iso (5,699MB)

    --
    Mike Easter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Paul@21:1/5 to All on Thu Oct 12 02:37:28 2023
    On 10/11/2023 4:04 PM, bilsch01 wrote:
    On 10/10/2023 6:59 PM, Mike Easter wrote:
    bilsch01 wrote:
    Windows wont format the drive because it says it's read only, however DISKPART tells me it's not read only. Can't I just zero fill it and start over?

    Rufus 'ordinary' (quick, not quick, and check for bad blocks - but not zero) format will probably (highly likely) format it.  If I want to zero you could use diskpart after rufus formats it.

    Personally, I would just Rufus quick, not not-quick, not check bad blocks and not zero.

    Rufus is Win, small, free, and doesn't need install.  It is also VERY good Win tool for writing linux .iso/s to USB more than one way; hybrid or dd-style.  And can even do a form of persistence for some .iso/s.

    I had looked at Rufus to start with, however it seemed Rufus didn't like the flash drive, so I decided to zero fill it - which I just did. Next I used current version of Rufus off of the web to make the drive a
    Ubuntu 22.04.03 installer using the downloaded Ubuntu iso. That worked, but Rufus warned that maybe the version of Grub (that Rufus would use) might not be absolutely compatible with the installer. I went ahead anyway. The drive boots the 'Try Ubuntu'
    option fine. But maybe a system installed with the drive might have a Grub problem. I decided I won't use the installer to install right now.

    The reason I'm doing all this is I want to delete the SWAP partition I put on my HDD when I installed my 20.04 system, and I heard that current version of Ubuntu uses a SWAP file instead. There is a SWAP file even on my 20.04 system, but I have
    concerns. I wrote a post on
    comp.sys.ibm.pc.hardware.storage
    about that.

    Thanks for your answer about Rufus. Actually, the reason I know about Rufus is because you told me about it years ago on usenet.

    This is a blurb from my notes.

    *******
    If you find Ubuntu booting slowly, because it searches for btrfs, mdadm,
    this is caused by an invalid swap UUID. (This happens when you install
    a second copy of Linux and swap is re-formatted.)

    Your options are

    Option 1

    Edit /etc/fstab and correct the blkid of swap.

    Option 2

    Initramfs also has a swap check.

    open /etc/initramfs-tools/conf.d/resume
    replace RESUME=UUID=xxx with RESUME=none (or use the correct blkid!)
    issue sudo update-initramfs -u
    reboot your system

    I did an update-grub just in case.

    Another modification you could make, is /etc/default/grub
    and change "quiet splash" to "quiet splash noresume" then update-grub.

    It all depends on whether you want hibernation support, as to
    which direction you go with the modifications. (Correct the BLKID, or
    just blow the silly stuff away with noresume.)

    *******

    Now, I checked how my Ubuntu 22.04 is configured on the other machine.
    Shocked I was.

    /etc/default/grub
    GRUB_TIMEOUT_STYLE=menu
    GRUB_CMDLINE_LINUX_DEFAULT="noresume"
    /etc/initramfs-tools/conf.d/resume
    RESUME=UUID=f64d8e53-de8f-4f9a-b8e1-2fe07e66cfde <=== matches no BLKID, sounds like an old swap value
    I am a bad monkey, for not taking my own advice.

    And that was, in fact, the swap partition UUID when Ubuntu was first installed.

    So it looks like, on the monitor to the left of me, that Ubuntu OS
    used the boot-line "noresume" to bypass the fact I had not
    corrected using update-initramfs -u .

    Paul

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bilsch01@21:1/5 to Marco Moock on Thu Oct 12 09:23:27 2023
    On 10/10/2023 11:30 PM, Marco Moock wrote:
    Am 10.10.2023 um 18:27:50 Uhr schrieb bilsch01:

    Can somebody please tell me a dd copy command line that will
    zero-fill this drive?

    sudo dd=if=/dev/zero of=/dev/sdX bs=4M

    Replace X with the driver letter, use lsblk to get it.
    Make sure no partition of the drive is being mounted.

    Thanks for the dd copy line. I thought I said that yesterday but now I
    see the intended post 'saying Thanks' was defective.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Mike Easter@21:1/5 to Mike Easter on Thu Oct 12 15:07:33 2023
    Mike Easter wrote:
    Ub 22.04.3 is SO FAT that it can't be written to a fat32 USB.

    Twiddling w/ that Ub, partly because I hate Gnome shell so much I tho't
    I ought to become better acquainted w/ it. I can't even find simple
    things easily, set the tz, enable sticky keys. I have to search around.

    And THEN... here I am w/ this bloated distro and it doesn't have some
    things I want by default; no inxi, no synaptic, AND... they aren't even
    in the default repo/s!!

    So, I have to command up some more repo/s
    sudo add-apt-repository universe (and multiverse)

    Furrfu!

    --
    Mike Easter

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From bilsch01@21:1/5 to Mike Easter on Fri Oct 13 08:57:56 2023
    On 10/11/2023 7:28 PM, Mike Easter wrote:
    Mike Easter wrote:
    bilsch01 wrote:
    Mike Easter wrote:

    Next I used current version of Rufus off of the web to make the drive
    a Ubuntu 22.04.03 installer using the downloaded Ubuntu iso. That
    worked, but Rufus warned that maybe the version of Grub (that Rufus
    would use) might not be absolutely compatible with the installer.

    I'm not familiar w/ such an experience.  It interests me enough that
    I think I'll dust off the laptop that has W10 on it which is the only
     thing I have that can run the current Rufus 4.2 and see what happens
    if I write the Ub 22.04.03 with it.  The newest Rufus is '23 Jul and
    that Ub is '23 Aug.  Usually if Rufus 'alerts' on something, it is
    about the syslinux and it has a 'stockpile' of versions online that
    it can fetch for itself if needed.

    I did all that; used the W10 LT + Rufus 4.2 + Ub 22.04.3 and you are
    correct the alert is about grub, not syslinux, but I would consider that alert 'negligible' as it is about the 'language' difference between grub
    2.06 and the Ub v. of grub 2.06-2ubuntu7.2.  Rufus even offers to go
    online and see if it can find access to dl the slightly differently
    named grub 2.06.
    Thanks for this info



    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)