1TB ssd reported as 8MB in fdisk (or gdisk)
by slac-in-the-box from LinuxQuestions.org on (#6QX5E)
Howdy LQ:
My goal: use dd to burn a disk image file onto a new 1TB external usb ssd.
The command I used:Code:dd if=/home/sib0.dmg of=/dev/sda bs=512 status=progressIt finished much much quicker than expected, only writing 8MiB of data and then complaining that the brand new external ssd was full already.
About this external ssd:
Yes it is a SanDisk. I read on some other threads here, about some who had unreliable experiences with SanDisk, and don't use them: but this is my first such experience--before this, my 250GB SanDisk SSDs all performed as expected.
But this new 1TB one is different. It is a SanDisk Extreme Pro Portable SSD, Model Number SDSSDE81-IT00 (I think, because that information was printed in way too small a font for my aging eyes). Here is what lsusb says about it:Code:cli# lsusb
Bus 003 Device 070: ID 0781:55af SanDisk Corp. Extreme Pro 55AFAfter plugging in its usb, dmesg identifies it as /dev/sda with partition /dev/sda1.
I did not care (but maybe I should have) about whatever partition table, partitions, file systems, or data might already be on it, because, I was under the impression that dd would simply write over the entire drive, including the partition table.
So I proceeded with the dd command first, and only started looking deeper into when it only wrote 8MiB. So I used gdisk to print the partition table, and it contained the gpt table from the /home/sib0.img disk image I was trying to burn with dd, and complained about partition being out of disk boundaries, or something like that. And so I typed "o" to create a new GPT, and "w" to write it. When I print it says this:
Code:Disk /dev/sda: 16384 sectors, 8.0 MiB
Model: Extreme Pro 55AF
Sector size (logical): 512 bytes
Disk identifier (GUID): 421B8DE2-B965-4840-9B34-013BFC98187D
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 16350
Partitions will be aligned on 2048-sector boundaries
Total free space is 16317 sectors (8.0 MiB)I was in tty at run level 3, and decided to startx, so I could use a graphical browser to search about it, and once the full wayland kde5 plasma started up, a pop-up window immediately opened up showing that it found the external ssd, and mounted it. In Dolphin, the folder under the extreme pro that popped up, said it had 931.5 GiB free space remaining. In this extreme pro folder, there are two files, "Install Security for Mac.zip" and "Install Security for Windows.zip," as well as a subfolder, entitled "System Volume Information," that contains another two files: "IndexerVolumeGuid" and "WPsettings.dat."
In dolphin, I right clicked on extreme pro, and chose properties--and it reported that the file system for /dev/sda1 was exfat.
About the Image I am burning:
It was also created with dd, using /dev/urandom for input file, and /home/sib0.img as output file. (I read that the random data helps hide where encrypted partitions begin and end, which is why I used urandom). After that, I used parted on the file, and gave it a 4 MiB partition to help align it (according to man parted, that can help on some sd and micro sd cards); and then a second 156MB EFI partition, and a 3rd LVM partition filling the rest. I then used losetup to find the next available loop, and scan for partitions. I encrypted /dev/loop0p3 with luks2. I created my volume group and logical volumes for root, tmp, var, and home and formatted all of them with ext4. I made mountpoints and mounted these volumes, and then installed slackware to them with slackwares installpkg --root command. I bind mounted /sys and /proc and chrooted in to the mounted root volume, and configured /etc/hosts /etc/fstab, made a root password, made an initial ramdisk, and put the ram disk and kernel in the efi partition, and configured elilo to find them. I then closed all of that back down in reverse, and have created what I believe to be a bootable disk image. I want to test it out by burning it to the SSD, and then trying to boot from it. But as reported, only 8MiB was written.
My conjecture as to why this is happening:
Reading around, I've learned that the device had a protective MBR. I'm not clear on how that works, but it kind of hides a backup partition table that's not right at the beginning of the disk. Bumbling around in the "expert" area of gparted, though I am no expert at all, or I wouldn't be here, I saw a "z" for Zap all gpt partition data. I chose this, and it also gave me option to zap protective MBR. And I did. After that, the next time I opened /dev/sda with gdisk, it says no MBR, BSD, APM, or GPT are present:
Code: gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.10
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries in memory.
Command (? for help): Yet, going back to Dolphin, it still finds /dev/sda1 formatted as exfat, with the 931.5 GB of free space, and the two files and subfolder are still there.
So, does this have to do with exfat? -- I've never used it, and it's the first I've heard of this newer unfriendly windows file system.
The question: Does anybody have any suggestions, tips, or clues as to why the linux disk utilities all think this drive is only 8MiB, and as to what I could do to fix it, preferably using the tools that come with Linux? (if necessary, I could use a friend's windows box to try to reformat it as fat32, and maybe it would play friendly when it got back to linux. But that takes traveling to the windows box, and I live an hours drive from the nearest fuel station, so I hope I can get it figured out with linux only.) Any and all positive suggestions are greatly appreciated. I'm running out of hair, from pulling it all out over this. Cheers LQ.
My goal: use dd to burn a disk image file onto a new 1TB external usb ssd.
The command I used:Code:dd if=/home/sib0.dmg of=/dev/sda bs=512 status=progressIt finished much much quicker than expected, only writing 8MiB of data and then complaining that the brand new external ssd was full already.
About this external ssd:
Yes it is a SanDisk. I read on some other threads here, about some who had unreliable experiences with SanDisk, and don't use them: but this is my first such experience--before this, my 250GB SanDisk SSDs all performed as expected.
But this new 1TB one is different. It is a SanDisk Extreme Pro Portable SSD, Model Number SDSSDE81-IT00 (I think, because that information was printed in way too small a font for my aging eyes). Here is what lsusb says about it:Code:cli# lsusb
Bus 003 Device 070: ID 0781:55af SanDisk Corp. Extreme Pro 55AFAfter plugging in its usb, dmesg identifies it as /dev/sda with partition /dev/sda1.
I did not care (but maybe I should have) about whatever partition table, partitions, file systems, or data might already be on it, because, I was under the impression that dd would simply write over the entire drive, including the partition table.
So I proceeded with the dd command first, and only started looking deeper into when it only wrote 8MiB. So I used gdisk to print the partition table, and it contained the gpt table from the /home/sib0.img disk image I was trying to burn with dd, and complained about partition being out of disk boundaries, or something like that. And so I typed "o" to create a new GPT, and "w" to write it. When I print it says this:
Code:Disk /dev/sda: 16384 sectors, 8.0 MiB
Model: Extreme Pro 55AF
Sector size (logical): 512 bytes
Disk identifier (GUID): 421B8DE2-B965-4840-9B34-013BFC98187D
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 16350
Partitions will be aligned on 2048-sector boundaries
Total free space is 16317 sectors (8.0 MiB)I was in tty at run level 3, and decided to startx, so I could use a graphical browser to search about it, and once the full wayland kde5 plasma started up, a pop-up window immediately opened up showing that it found the external ssd, and mounted it. In Dolphin, the folder under the extreme pro that popped up, said it had 931.5 GiB free space remaining. In this extreme pro folder, there are two files, "Install Security for Mac.zip" and "Install Security for Windows.zip," as well as a subfolder, entitled "System Volume Information," that contains another two files: "IndexerVolumeGuid" and "WPsettings.dat."
In dolphin, I right clicked on extreme pro, and chose properties--and it reported that the file system for /dev/sda1 was exfat.
About the Image I am burning:
It was also created with dd, using /dev/urandom for input file, and /home/sib0.img as output file. (I read that the random data helps hide where encrypted partitions begin and end, which is why I used urandom). After that, I used parted on the file, and gave it a 4 MiB partition to help align it (according to man parted, that can help on some sd and micro sd cards); and then a second 156MB EFI partition, and a 3rd LVM partition filling the rest. I then used losetup to find the next available loop, and scan for partitions. I encrypted /dev/loop0p3 with luks2. I created my volume group and logical volumes for root, tmp, var, and home and formatted all of them with ext4. I made mountpoints and mounted these volumes, and then installed slackware to them with slackwares installpkg --root command. I bind mounted /sys and /proc and chrooted in to the mounted root volume, and configured /etc/hosts /etc/fstab, made a root password, made an initial ramdisk, and put the ram disk and kernel in the efi partition, and configured elilo to find them. I then closed all of that back down in reverse, and have created what I believe to be a bootable disk image. I want to test it out by burning it to the SSD, and then trying to boot from it. But as reported, only 8MiB was written.
My conjecture as to why this is happening:
Reading around, I've learned that the device had a protective MBR. I'm not clear on how that works, but it kind of hides a backup partition table that's not right at the beginning of the disk. Bumbling around in the "expert" area of gparted, though I am no expert at all, or I wouldn't be here, I saw a "z" for Zap all gpt partition data. I chose this, and it also gave me option to zap protective MBR. And I did. After that, the next time I opened /dev/sda with gdisk, it says no MBR, BSD, APM, or GPT are present:
Code: gdisk /dev/sda
GPT fdisk (gdisk) version 1.0.10
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries in memory.
Command (? for help): Yet, going back to Dolphin, it still finds /dev/sda1 formatted as exfat, with the 931.5 GB of free space, and the two files and subfolder are still there.
So, does this have to do with exfat? -- I've never used it, and it's the first I've heard of this newer unfriendly windows file system.
The question: Does anybody have any suggestions, tips, or clues as to why the linux disk utilities all think this drive is only 8MiB, and as to what I could do to fix it, preferably using the tools that come with Linux? (if necessary, I could use a friend's windows box to try to reformat it as fat32, and maybe it would play friendly when it got back to linux. But that takes traveling to the windows box, and I live an hours drive from the nearest fuel station, so I hope I can get it figured out with linux only.) Any and all positive suggestions are greatly appreciated. I'm running out of hair, from pulling it all out over this. Cheers LQ.