View previous topic :: View next topic |
Author |
Message |
pjp Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1154772887439692d88303b.jpg)
Joined: 16 Apr 2002 Posts: 20589
|
Posted: Fri Jul 09, 2021 3:28 am Post subject: Flash drive with phantom partitions? |
|
|
I don't recall having ever noticed this situation where partitions appear to exist but aren't accessible.
And I'm certain that I've never created a Netware partition on this disk (or this century). Code: | $ fdisk -l /dev/sdf
Disk /dev/sdf: 3.73 GiB, 4004511744 bytes, 7821312 sectors
Disk model:
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: 0x6f20736b
Device Boot Start End Sectors Size Id Type
/dev/sdf1 778135908 1919645538 1141509631 544.3G 72 unknown
/dev/sdf2 168689522 2104717761 1936028240 923.2G 65 Novell Netware 386
/dev/sdf3 1869881465 3805909656 1936028192 923.2G 79 unknown
/dev/sdf4 2885681152 2885736650 55499 27.1M d unknown
Partition table entries are not in disk order.
$ ls /dev/sdf*
/dev/sdf | sdf mounts as vfat, which aligns with its usage. There were no errors copying data from it. Code: | $ mount /dev/sdf /mnt/
$ df -h /mnt/
Filesystem Size Used Avail Use% Mounted on
/dev/sdf 3.8G 2.5G 1.4G 65% /mnt | It is only a curiosity. I thought I'd see if anyone had encountered and understood what was going on with the partitions. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
figueroa Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/911990856608daafc46b9c.gif)
Joined: 14 Aug 2005 Posts: 3007 Location: Edge of marsh USA
|
Posted: Fri Jul 09, 2021 4:20 am Post subject: |
|
|
Once upon a time, some SanDisk flash drives came with phantom partitions and/or files that couldn't be deleted. The best way to handle that is to remove the partition table and apply a new partition table onto the flash drive, then set up and format your partition(s).
The other solution is to hit it with a big hammer. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pjp Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1154772887439692d88303b.jpg)
Joined: 16 Apr 2002 Posts: 20589
|
Posted: Fri Jul 09, 2021 6:19 am Post subject: |
|
|
It isn't a SanDisk by packaging. I don't know if they allowed anyone to rebrand their stuff.
I'm wondering if it is because I formatted it without a partition. There was a brief period when I thought that sounded like a Good Idea, though I no longer recall the reasons*.
I doubt I created partitions that looked as these do. It is very likely that I created and formatted it from a Windows system.
To prevent late hour mistakes, I'll be waiting until morning to put a a sysrescuecd image onto it. At least with morning mistakes, there's less loss of sleep and the whole day to enjoy the experience. (:
* The reason to NOT do it is because without the partition number, it is less obvious that something is on the disk. Minor, but worth it in my experience. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
NeddySeagoon Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/3946266373f47d606a2db3.jpg)
Joined: 05 Jul 2003 Posts: 54834 Location: 56N 3W
|
Posted: Fri Jul 09, 2021 7:18 am Post subject: |
|
|
pjp,
Can you mount /dev/sdf ?
If so the partition table rubbish is whatever the filesystem needs to be there and can safely be ignored. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Goverp Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/152613747847c6fd276c31a.jpg)
Joined: 07 Mar 2007 Posts: 2202
|
Posted: Fri Jul 09, 2021 7:54 am Post subject: |
|
|
This sort of confusion is behind the advice that in general you should partition a disk/SD card even if you know for sure it will only every have 1 partition on it. It's such an uncommon usage, you're likely to trip over yourself. Especially as in this case where the random stuff on the disk might fool linux into creating spurious /dev/sdf1-4. (You don't say if that's happened or not.)
You're only safe until you mount one of them R/W and try something that causes output to it...
As Neddie says, it's not a partition table, just some hex that can be interpreted as one by a gullible fdisk (hence the out-of-order partitions, weird types, and 2.5TB on a 4GB drive). _________________ Greybeard |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Romanticio Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/75064449760559b36a1cd7.jpg)
Joined: 07 Feb 2021 Posts: 76
|
Posted: Fri Jul 09, 2021 9:50 am Post subject: |
|
|
In the past, there were USB flash drives with emmc set-ups. They were often executable when plugged into a Windows box and launched some application etc. These type of drives had similar partition structure to an emmc chip which is typically four partitions. There is a specific name for these drives which currently eludes me at the moment as I've not heard much about them in recent times.
In those set-ups the fourth partition is typically the user-space partition, not sure if running 'dd if=/dev/zero' on the device got rid of them or just showed the user-space partition as an empty drive. mmc-utils was not popular back then but that may be the utility needed to delete the emmc setup and perhaps create a normal DOS partition afterwards.
EDIT: You could test it to see if it is one of those old drives by installing mmc-utils and run fdisk -l again to see if it gives better output. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Jaglover Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/179708169458f2999e44e26.gif)
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
Posted: Fri Jul 09, 2021 1:53 pm Post subject: |
|
|
Goverp wrote: | This sort of confusion is behind the advice that in general you should partition a disk/SD card even if you know for sure it will only every have 1 partition on it. |
Why? I never partition my devices for a single filesystem, even hard drives. The meaning of partition is cutting into pieces after all. Having one partition which fills whole drive is nonsense, it is no longer a partition then. Smells Microsoft.
The partition table is bytes 447-500 of first sector, I formatted one of my flash drives with VFAT and there is no partition table, as expected. All bytes are '00'.
What Romantico wrote about EMMC drives is interesting, it may be the explanation. _________________ My Gentoo installation notes.
Please learn how to denote units correctly! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pjp Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1154772887439692d88303b.jpg)
Joined: 16 Apr 2002 Posts: 20589
|
Posted: Fri Jul 09, 2021 2:40 pm Post subject: |
|
|
NeddySeagoon wrote: | Can you mount /dev/sdf ?
If so the partition table rubbish is whatever the filesystem needs to be there and can safely be ignored. | It is mountable, and that was my presumption, but it is still awkward to experience (at least for the first time).
Goverp wrote: | This sort of confusion is behind the advice that in general you should partition a disk/SD card even if you know for sure it will only every have 1 partition on it. It's such an uncommon usage, you're likely to trip over yourself. Especially as in this case where the random stuff on the disk might fool linux into creating spurious /dev/sdf1-4. (You don't say if that's happened or not.) | I agree regarding not using partitions. That was a brief phase of experimentation on my part ;). Fortunately I grew out of it.
As I referenced, but didn't explicitly state, fdisk sees the partitions, but they do not exist in /dev. From that I would deduce that linux was not fooled into creating sdf1-4? Or did you mean something else?
Goverp wrote: | You're only safe until you mount one of them R/W and try something that causes output to it...
As Neddie says, it's not a partition table, just some hex that can be interpreted as one by a gullible fdisk (hence the out-of-order partitions, weird types, and 2.5TB on a 4GB drive). | Trying to use it would be interesting, if I could have. But I doubt I would have tried relying on it with such odd start and end sectors. If not for the out of order partitions, I might have just presumed that some bits flipped and affected the partition names. I don't see a reference to 2.5TB though. Everything seems within reason without calculating sizes. Total 3.7G. Partitions 1 - 4 at 544G, 923G, 923G and 27M. That a little over 2.3G, not T. The out of order partitions are the biggest indicator that the partitions shouldn't be used (if they existed). _________________ Quis separabit? Quo animo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pjp Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1154772887439692d88303b.jpg)
Joined: 16 Apr 2002 Posts: 20589
|
Posted: Fri Jul 09, 2021 2:52 pm Post subject: |
|
|
Romanticio wrote: | In the past, there were USB flash drives with emmc set-ups. They were often executable when plugged into a Windows box and launched some application etc. These type of drives had similar partition structure to an emmc chip which is typically four partitions. There is a specific name for these drives which currently eludes me at the moment as I've not heard much about them in recent times. | That is interesting. I'm only aware of the MS autorun feature.
Romanticio wrote: | In those set-ups the fourth partition is typically the user-space partition, not sure if running 'dd if=/dev/zero' on the device got rid of them or just showed the user-space partition as an empty drive. mmc-utils was not popular back then but that may be the utility needed to delete the emmc setup and perhaps create a normal DOS partition afterwards.
EDIT: You could test it to see if it is one of those old drives by installing mmc-utils and run fdisk -l again to see if it gives better output. | I would guess that this device was purchased between 2008 and 2010. But it was purchased as a basic flash drive, not as something expected to provide an application. Behold the power of reading... it is a "Relay", which is apparently the brand of Staples (a US office supply store). That only slightly affects the likely purchase date as I had thought I purchased it elsewhere. I was looking for low profile devices, and this is about the lowest profile I could find. Other than color, it looks exactly like this one (Amazon).
I'd like to try the mmc-utils out of curiosity, but they aren't in ::gentoo, so I'll have to wait until another time. As the partitions don't appear to exist, I'm leaning toward it merely being data that simply appears partition-like. In a data recovery situation, it is probably good that fdisk isn't trying to filter those results. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pjp Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1154772887439692d88303b.jpg)
Joined: 16 Apr 2002 Posts: 20589
|
Posted: Fri Jul 09, 2021 2:56 pm Post subject: |
|
|
Jaglover wrote: | Why? I never partition my devices for a single filesystem, even hard drives. The meaning of partition is cutting into pieces after all. ;) Having one partition which fills whole drive is nonsense, it is no longer a partition then. Smells Microsoft.
The partition table is bytes 447-500 of first sector, I formatted one of my flash drives with VFAT and there is no partition table, as expected. All bytes are '00'.
What Romantico wrote about EMMC drives is interesting, it may be the explanation. | For me, as I mentioned, clarity. I prefer the explicit "yes, a partition has been created on this device." If I had created a partition on this device, I wonder if I would see the false partition tables. A small technical reason, probably no longer applicable, would be for proper alignment.
Thanks for the comments everyone! _________________ Quis separabit? Quo animo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
figueroa Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/911990856608daafc46b9c.gif)
Joined: 14 Aug 2005 Posts: 3007 Location: Edge of marsh USA
|
Posted: Fri Jul 09, 2021 3:05 pm Post subject: |
|
|
Get a calculator! 923G + 923G = 1,846 G which is greater than a Terabyte.
I do and will continue to put partitions on flash drives, except when DDing an image (ISO) to one. It helps create order in a world of chaos. _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pjp Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1154772887439692d88303b.jpg)
Joined: 16 Apr 2002 Posts: 20589
|
Posted: Fri Jul 09, 2021 3:57 pm Post subject: |
|
|
As I mentioned, I prefer to make mistakes in the morning :)
I was really hoping to avoid using dd, but the referenced instructions for multiboot fail to create the hybrid setup to boot an iso image.
If there was one utility I could make "go away," it would be dd (yes, I know it is useful). I'm just amazed that it is still this painful to get a USB drive to boot. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Fitzcarraldo Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/32674073548b9c27b587f8.jpg)
Joined: 30 Aug 2008 Posts: 2056 Location: United Kingdom
|
Posted: Fri Jul 09, 2021 4:41 pm Post subject: |
|
|
https://www.linuxquestions.org/questions/linux-general-1/fdisk-strange-usb-mass-storage-drive-4175544927/
rknichols wrote: | It's finding garbage where the partition table should be and then printing what these obviously invalid entries would mean if they were part of a partition table. None of the entries make any sense. All of the Start and End sector offsets are beyond the end of the disk. That "Novell Netware 386" is just from a byte that happens to have the value 0x65 in the location where the ID for partition 2 would reside. The ID field values for the other partitions don't correspond to any known system type. |
Seems like a reasonable explanation. _________________ Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.
My blog |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Jaglover Watchman
![Watchman Watchman](/images/ranks/rank-G-2-watchman.gif)
![](images/avatars/179708169458f2999e44e26.gif)
Joined: 29 May 2005 Posts: 8291 Location: Saint Amant, Acadiana
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23093
|
Posted: Fri Jul 09, 2021 7:21 pm Post subject: |
|
|
pjp wrote: | Trying to use it would be interesting, if I could have. But I doubt I would have tried relying on it with such odd start and end sectors. | You have the sense not to proceed based on this oddity, but what if you had plugged this device into a system where the Desktop Environment "helpfully" automatically mounts any external storage it can find, immediately and without asking? You wouldn't get a chance to review the bogus partition table and realize that it was garbage before the system, under direction of the helpful DE, started using it. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
pjp Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
![](images/avatars/1154772887439692d88303b.jpg)
Joined: 16 Apr 2002 Posts: 20589
|
Posted: Fri Jul 09, 2021 7:39 pm Post subject: |
|
|
Hu,
That's a good point, but I don't normally inspect partition tables before manually mounting them and using them.
When I prepare a new disk, I put "appropriate" care into how that is done, but I don't normally bother with it after that.
The only reason I noticed it in this case is because I was looking for a flash drive that I could repurpose for an HDD swap. I suppose it is possible I had seen it in the past and have no memory of it. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Romanticio Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
![](images/avatars/75064449760559b36a1cd7.jpg)
Joined: 07 Feb 2021 Posts: 76
|
Posted: Fri Jul 09, 2021 8:03 pm Post subject: |
|
|
Running fdisk on this device from Ubuntu live may give proper results. Ubuntu comes with mmc-utils preinstalled.
The name of the drives whose name eluded me previously is "U3"
Quote: | In Windows Vista and later versions, ReadyBoost feature allows flash drives (from 4 GB in case of Windows Vista) to augment operating system memory |
Windows ReadyBoost
U3 drives are prepared/setup with mmc-utils |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Hu Administrator
![Administrator Administrator](/images/ranks/rank-admin.gif)
Joined: 06 Mar 2007 Posts: 23093
|
Posted: Fri Jul 09, 2021 8:15 pm Post subject: |
|
|
pjp wrote: | That's a good point, but I don't normally inspect partition tables before manually mounting them and using them. | That's fair. I was thinking of the situation that you show that level of caution for a USB stick you had pulled out of a drawer where you didn't remember what you had last done with it, but would be less cautious on devices you're sure you know what they contain. The DE won't distinguish, and will be equally aggressive on all of them. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|