Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[SOLVED] Why is GParted or cfdisk so buggy with Live USB ?
- TheExplorer
- Posts: 254
- Joined: 2010-05-31 15:04
[SOLVED] Why is GParted or cfdisk so buggy with Live USB ?
Guys, why GParted or cfdisk doesn't work as expected with Live Linux USB flash sticks ?
I mean when you dd or cp a Linux distro .iso onto any USB flash stick and then, after a while, decide to clean it and bring it to its original state.
GParted starts showing me lots of warnings like: 'we need to inform the kernel about something, but we can't... you need to reboot' and driver descriptors and physical block sizes mismatch like this one, etc, etc.
I also tried cfdisk to erase all partitions on it but was getting the same errors and warnings.
In order to make a clean USB stick I need to reboot and accomplish this successfully with Winblows' Drive Management tool
Am I doing something wrong? What other tools do you, guys, use when working with USB ?
Thank you in advance.
I mean when you dd or cp a Linux distro .iso onto any USB flash stick and then, after a while, decide to clean it and bring it to its original state.
GParted starts showing me lots of warnings like: 'we need to inform the kernel about something, but we can't... you need to reboot' and driver descriptors and physical block sizes mismatch like this one, etc, etc.
I also tried cfdisk to erase all partitions on it but was getting the same errors and warnings.
In order to make a clean USB stick I need to reboot and accomplish this successfully with Winblows' Drive Management tool
Am I doing something wrong? What other tools do you, guys, use when working with USB ?
Thank you in advance.
Last edited by TheExplorer on 2018-03-24 07:20, edited 2 times in total.
Money is the evil of all root. Be free. Use Linux.
Re: Why does GParted or cfdisk is buggy with Live USB ?
I don't recall ever seeing that, but I found some links that might be helpful.
https://duckduckgo.com/html/?q=driver+d ... ze+warning
I think it's probably some unusual dd usage that caused your issue, but can't say for sure. Might be a good thing for you to follow up on, and let people know here so they don;t repeat the error? Thanks.
https://duckduckgo.com/html/?q=driver+d ... ze+warning
I don't think any method is doing anything wrong if it works, the thing is to "understand" the tools you use. I still like cfdisk, even though it's kind of old fashioned, and I sometimes use parted and fdisk. I'm still not a fan of gparted or other gui partition tools, but I think they work very well nowadays from what I have read.Am I doing something wrong? What other tools do you, guys, use when working with USB ?
I think it's probably some unusual dd usage that caused your issue, but can't say for sure. Might be a good thing for you to follow up on, and let people know here so they don;t repeat the error? Thanks.
resigned by AI ChatGPT
Re: Why does GParted or cfdisk is buggy with Live USB ?
Nowadays I use mostly gdisk, never had any issues. But then again, I do not partition USB sticks and hard drives for a single filesystem, I just create the filesystem on raw device. I think Windows cannot read a USB stick without partition table, but I couldn't care less. Last Windows crashed out here about 2004.
BTW, using ancient partitioning tools is a good way to create misaligned partitions.
BTW, using ancient partitioning tools is a good way to create misaligned partitions.
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Why does GParted or cfdisk is buggy with Live USB ?
The partition table(s) in some ISO hybrid images such as Debian installer ones is invalid and partitioning tools do not handle it properly.
The best thing to do is to erase all metadata with dd or wipefs, then create a new clean partition table with any partitioning tool.
The best thing to do is to erase all metadata with dd or wipefs, then create a new clean partition table with any partitioning tool.
- TheExplorer
- Posts: 254
- Joined: 2010-05-31 15:04
Re: Why does GParted or cfdisk is buggy with Live USB ?
Yep, exactly what I was looking for. It's indeed Debian hybrid ISO. Fdisk just hangs for 5 minutes while reading devices... It really annoys me.p.H wrote:The partition table(s) in some ISO hybrid images such as Debian installer ones is invalid and partitioning tools do not handle it properly.
The best thing to do is to erase all metadata with dd or wipefs, then create a new clean partition table with any partitioning tool.
Thank you for wipefs, didn't know about this one. And what should I do with dd? dd if=/dev/urandom > /dev/sdX ?
Money is the evil of all root. Be free. Use Linux.
Re: Why does GParted or cfdisk is buggy with Live USB ?
It's okay, wipefs is mentioned in cfdisk man page, and fdisk also has explanation for --wipe in it's man page. The idea I think is that if you dd a device with 2048 block size (like a cd/iso9660) onto another device that is 512 byte block size, then it is of course invalid, so you can't edit it interactively. That's not really "buggy" but yeah it is confusing. Man pages are your friend.TheExplorer wrote:It really annoys me.
resigned by AI ChatGPT
-
- Global Moderator
- Posts: 3049
- Joined: 2017-09-17 07:12
- Has thanked: 5 times
- Been thanked: 132 times
Re: Why does GParted or cfdisk is buggy with Live USB ?
Do not bother with urandom. /dev/zero is fine.
Also, you need to erase only the first 64 kB or so containing the MBR, the GPT primary header, the Apple partition table and the ISO 9660 header.
Also, you need to erase only the first 64 kB or so containing the MBR, the GPT primary header, the Apple partition table and the ISO 9660 header.
- TheExplorer
- Posts: 254
- Joined: 2010-05-31 15:04
Re: Why does GParted or cfdisk is buggy with Live USB ?
Thank you!p.H wrote:Do not bother with urandom. /dev/zero is fine.
Also, you need to erase only the first 64 kB or so containing the MBR, the GPT primary header, the Apple partition table and the ISO 9660 header.
Money is the evil of all root. Be free. Use Linux.
- TheExplorer
- Posts: 254
- Joined: 2010-05-31 15:04
Re: Why does GParted or cfdisk is buggy with Live USB ?
Got it. Thanks!bw123 wrote:It's okay, wipefs is mentioned in cfdisk man page, and fdisk also has explanation for --wipe in it's man page. The idea I think is that if you dd a device with 2048 block size (like a cd/iso9660) onto another device that is 512 byte block size, then it is of course invalid, so you can't edit it interactively. That's not really "buggy" but yeah it is confusing. Man pages are your friend.
Money is the evil of all root. Be free. Use Linux.
- Head_on_a_Stick
- Posts: 14114
- Joined: 2014-06-01 17:46
- Location: London, England
- Has thanked: 81 times
- Been thanked: 133 times
Re: Why is GParted or cfdisk so buggy with Live USB ?
I use gdisk to clear "live" USB sticks:
Code: Select all
# sgdisk --zap-all
deadbang
Re: Why does GParted or cfdisk is buggy with Live USB ?
I'm not having any problem reading my live usb with fdisk or cfdisk. From what I recall I made this one with dd, and used cfdisk to create the extra partitions. Again, it might be something to follow up on if you can narrow down the issue. I don't know whether it's the same on the regualr install images I don;t have one handy atm.TheExplorer wrote: Yep, exactly what I was looking for. It's indeed Debian hybrid ISO. Fdisk just hangs for 5 minutes while reading devices... It really annoys me.
Code: Select all
# fdisk /dev/sdc
Welcome to fdisk (util-linux 2.29.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.
Command (m for help): p
Disk /dev/sdc: 14.9 GiB, 16008609792 bytes, 31266816 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x4502db07
Device Boot Start End Sectors Size Id Type
/dev/sdc1 * 0 5049279 5049280 2.4G 0 Empty
/dev/sdc2 2136 2967 832 416K ef EFI (FAT-12/16/32)
/dev/sdc3 5050368 21827583 16777216 8G 83 Linux
/dev/sdc4 21827584 31266815 9439232 4.5G c W95 FAT32 (LBA)
Code: Select all
Partition type: Empty (0)
Attributes: 80
Filesystem UUID: 2017-06-20-01-10-31-00
Filesystem LABEL: d-live 9.0.1 kde amd64
Filesystem: iso9660
resigned by AI ChatGPT
- sunrat
- Administrator
- Posts: 6476
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 474 times
Re: Why is GParted or cfdisk so buggy with Live USB ?
This command should restore a USB key to original format, "superfloppy" mode unpartitioned:
(upper case "i")
Code: Select all
mkfs.vfat -I /dev/sdx
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
- TheExplorer
- Posts: 254
- Joined: 2010-05-31 15:04
Re: Why is GParted or cfdisk so buggy with Live USB ?
Ok, thanks!sunrat wrote:mkfs.vfat -I /dev/sdx
Money is the evil of all root. Be free. Use Linux.
- sunrat
- Administrator
- Posts: 6476
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 474 times
Re: [SOLVED] Why is GParted or cfdisk so buggy with Live USB
Make sure to replace the "x" with the correct letter for your drive, check with
And the drive must be unmounted first.
Code: Select all
dmesg |tail
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
- TheExplorer
- Posts: 254
- Joined: 2010-05-31 15:04
Re: [SOLVED] Why is GParted or cfdisk so buggy with Live USB
Yeah, I know. Thanks!
Money is the evil of all root. Be free. Use Linux.