The partition table has been rewritten, but your filesystems and files are still intact. If you can remember the size(s) of the partititions on sda, just use fdisk to recreate the original partition table. If you can't remember them, you could try gpart.
In interactive mode, if there is no partition table on the disk, the user is given the options of creating a default partitioning or specifying the initial table values. The default partitioning allocates the entire disk for the Solaris system and makes the Solaris system partition active.In either case, when the initial table is created, fdisk also writes out the first-stage bootstrap (x86 only) code along with the partition table. In this mode, (x86 only) when creating an entry for a non-EFI partition on a disk that is larger than 2 TB (terabytes), fdisk warns that the maximum size of the partition is 2 TB. Under these conditions percentages displayed by fdisk are based on 2 TB.
The second mode of operation is used for automated entry addition, entry deletion, or replacement of the entire fdisk table. This mode can add or delete an entry described on the command line. In this mode the entire fdisk table can be read in from afile replacing the original table. fdisk can also be used to create this file. There is a command line option that will cause fdisk to replace any fdisk table with the default of the whole disk for the Solaris system.
When fdisk creates a partition, the space is allocated in the fdisk partition table, but the allocated disk space is not initialized. newfs(8) is required to create and write file system metadata to the new partition, and format(8) is required to write the VTOC or EFI/GPT metadata.
This option allows the user to switch between the current fdisk operating system partition identifier and the previous one. This does not affect any data in the disk partition and is provided for compatibility with older software.
Displays the logical drive information to stdout. This output reflects any changes made during the current run of the fdisk program. The changes are not committed to the disk until return to the main menu (using the submenu r) and choose the option tocommit the changes to the disk.
The fdisk_file contains four specification lines for the primary partitions followed by specification lines for the logical drives. You must have four lines for the primary partitions if there is at least one logical drive. In this case, if the number of primarypartitions to be configured is less than four, the remaining lines should be filled with zeros.
The relative sector from the beginning of the disk where the partition starts. This must be specified and can be used by fdisk to fill in other fields. For logical drives, you must make sure that there are at least 63 free sectors before the rsect specifiedfor a logical drive.
Last time I shrank a partition, it was just as easy as deleting it and recreating it from the same start sector. But this time, fdisk won't allow to recreate the partition from sector 63, it forces 2048 as a minimum.
I also had the problem that I couldn't keep the original start block. I used cfdisk. cfdisk could do it right and much easier then fdisk! Just select 'resize' and enter the amount of diskspace. And 'write' when you are satisfied with your configuration. That's it!And as you can see, it doesn't have the disadvantage of writing on the fly.
If you must do it using fdisk, try using an older distribution (or at least an older version of fdisk). Newer versions of fdisk don't seem to provide a way to specify a start sector as small as you want to use, although that is perfectly legal and was the standard until recently (2-3 years ago for Linux; up to Windows XP for Windows). Be careful about units, though -- older versions of fdisk used the fictitious "cylinder" values by default. Those values are imprecise, and the piecemeal changes in fdisk mean that you might not get the behavior you expect with certain in-between versions.
I split a partition in two with fdisk, but after rebooting I've got partition in FAT filesystem (was ext4). What's can be wrong? And how to fix it or get data from bad partition? I hope this is possible.List of commands what I did:
For some reason, fdisk create wrong partition offset (thanks to @frostschutz). And testdisk couldn't found anything what I need with [Intel] and not created with vista options (he found only sda2 partition). When I put Yes for his question about vista, he was find needed partition with Deep search. They was cannot be restored without deleting sda2 and sda4. So I put sda3 back (with deleting sda2 and sda4 partitions) and all my data comes back. After that I created new sda2 and sda4 partitions.
Also I try to use PhotoRec but restored files looks strange and it was be only files without my folders.
I'm sure this question has already been answered long ago, but for future reference, I believe fdisk reads partition sizes using M, not MB. In this case, you would need to change your final partition size to +536M.
My goal is to use the finding from 'fdisk -l grep Disk' to run an if statement based off what it finds. Basically, my school has 2 harddrive sizes, 320GB and 500GB. If it finds a 320GB drive, it should continue with the partition. If it finds a 500GB it should stop.
I ran into this few times saying can see, can't do anything was few minutes on DBAN or use linux live cd to delete all the partition and wipe hd clean cleared the filesystem enough so fdisk will work again.
EDIT : If you want to use the fixed version for the KB article, just download the EXE file appropriate for your locale, unzip using 7zip (or whatever you prefer), rename either fdisk.98g (Windows 98 first edition) or fdisk.98s (second edition) to fdisk.exe and use that on your diskette .
When I connect the SSD to the M2 connector from the standard Jetson Nano carried board, the Jetson could boot (Stuck on Nvidia Logo) or after 2 minutes. The NVMe is visible in the lspci but not in the fdisk.
df19127ead