Originally Posted by theycallmereece
reece@reece-SATELLITE-C50-A-1DV ~ $ sudo fdisk
[sudo] password for reece:
fdisk [options] <disk> change partition table
fdisk [options] -l <disk> list partition table(s)
fdisk -s <partition> give partition size(s) in blocks
-b <size> sector size (512, 1024, 2048 or 4096)
-c[=<mode>] compatible mode: 'dos' or 'nondos' (default)
-h print this help text
-u[=<unit>] display units: 'cylinders' or 'sectors' (default)
-v print program version
-C <number> specify the number of cylinders
-H <number> specify the number of heads
-S <number> specify the number of sectors per track
same thing ?
i give up i guess im stuck with linux -_-
You're not issuing the command correctly. 'fdisk' is just a program, you need to tell it what to do. Example: "fdisk -l" will list all devices such as HD's and CD's.
Here's my output, as a reference:
XX@XX:~$ su -
root@XX:~# fdisk -l
Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disklabel type: dos
Disk identifier: 0xec497085
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 1936750591 1936748544 923.5G 83 Linux
/dev/sda2 1936752638 1953523711 16771074 8G 5 Extended
/dev/sda5 1936752640 1953523711 16771072 8G 82 Linux swap / Solaris
As seen above, my HardDrive is "/dev/sda", so I want to execute dd on it to erase the MBR:
dd if=/dev/zero of=/dev/sda bs=512 count=1
# efibootmgr -b * -B
But remember to keep a backup of your MBR BEFORE doing the commands above:
dd if=/dev/sda of=/home/your-username/mbr bs=512 count=1
Then to restore it (in case the UEFI command above doesn't work):
dd if=/home/your-user/mbr of=/dev/sda bs=512 count=1
A little tutorial on DD:
" means the input. It could be a JPG image, or "/dev/zero
". dd will then read that file which cotains only "0000000000000". Or if it's the jpg image it will write it on the "of=/output
", which again, could be any device you want.
means the output, it could be a HDD, a fash drive, a partition... make sure to list them correctly before issuing the DD command as it will literaly destroy data if issued wrong.
tells 'dd' what blocksize it will write. The MBR is only 512 bytes, so that's what we tell it to do.
well, this is pretty simple. Unless we want to fill the entire drive, we tell dd to write that 512byes of zeroes just once.
So for example, if I have a JPG image that I want to fill in my flash drive, I'd first discover where that image is, e.g /home/amarildo/Pictures/mypicture.jpg
. Let's assume now that my flash drive is "/dev/sdb
". So, in order to fill that flash drive with the picture, I select the picture as INPUT and the drive as OUTPUT. Pretty simple, right?
dd if=/home/amarildo/Pictures/mypicture.jpg of=/dev/sdb