Engineering and technology notes

Linux Delete / Remove MBR – nixCraft

Linux Delete / Remove MBR

last updated in Categories

I‘ve installed an usb image on Pen drive along with MBR. Now, I need to use this USB pen for other purpose. Is there a way in Linux to delete the mbr (just like dos fdisk /mbr command)?

You can delete the mbr (master boot recored) using the dd command itself. A master boot record (MBR) is the 512-byte boot sector that is the first sector of a partitioned data storage device of a hard disk.

Understanding MBR size

The mbr size is as follows in bytes:

Where,446 + 64 + 2 = 512

  1. 446 bytes – Bootstrap.
  2. 64 bytes – Partition table.
  3. 2 bytes – Signature.
WARNING! These examples may crash your computer if executed. The following command will completely delete your MBR including all your partition information. So make sure you use the correct device name and block size in bytes.

Option #1: Command to delete mbr including all partitions

Open a terminal and type the following command command to delete everything:
# dd if=/dev/zero of=/dev/sdc bs=512 count=1
Sample outputs:

1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.00308483 s, 166 kB/s

Where,

  • if=/dev/zero – Read data from /dev/zero and write it to /dev/sdc.
  • of=/dev/sdc – /dev/sdc is the USB drive to remove the MBR including all partitions.
  • bs=512 – Read from /dev/zero and write to /dev/sdc up to 512 BYTES bytes at a time.
  • count=1 – Copy only 1 BLOCK input blocks.

Option #2: Command to delete mbr only

The following command will erase mbr, but not your partitions:
# dd if=/dev/zero of=/dev/sdc bs=446 count=1
Where,

  • bs=446 – Read from /dev/zero and write to /dev/sdc up to 446 BYTES bytes at a time.

Source: Linux Delete / Remove MBR – nixCraft

GNU Octave 5.1.0 Released with HiDPI Support (Howto Install)

How to Install Octave 5.1 in Ubuntu 18.04/16.04:

1. First open terminal (Ctrl+Alt+T) and make sure Flatpak support is enabled by running command:

sudo apt-get install flatpak

For Ubuntu 16.04, you need to add the Flatpak PPA first to be able to install Flatpak framework.

2. Then add the Flathub repository, the best place to get Flatpak apps:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

3. Finally install GNU Octave from the Flathub repository:

flatpak install flathub org.octave.Octave

It will take a few minutes downloading the flatpak package as well as dependency platform if you’re first time installing it.

Like normal applications, you can launch Octave from Gnome app launcher:

The flatpak co-exists with traditional Octave package. You can alternatively run it in command line:

flatpak run org.octave.Octave

Uninstall:

You can remove the Octave flatpak package by running command:

flatpak uninstall org.octave.Octave

And remove flatpak support if you want:

sudo apt-get remove flatpak

Source: GNU Octave 5.1.0 Released with HiDPI Support (Howto Install) | UbuntuHandbook

Matlab – LibXp.so.6 missing 15.10 – Ask Ubuntu

For Ubuntu 16.04 (Xenial Xerus) the following works.

Add the following line to /etc/apt/sources.list:

deb http://security.ubuntu.com/ubuntu precise-security main 

and run

sudo apt update
sudo apt install libxp6:i386

The :i386 suffix is only necessary if you need the 32 bit version.

You may also remove the source line from /etc/apt/sources.list afterwards.

Source: printing – LibXp.so.6 missing 15.10 – Ask Ubuntu