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

Linux Delete / Remove MBR – nixCraft was last modified: September 15th, 2019 by Jovan Stosic

Bash script for converting multiple DVD folders in avi/DiVX/XVID

c=$PWD
n=0
shopt -s dotglob
while IFS= read -r d ; do
CurrD[$n]=”$d”
echo ${CurrD[$n]}
n=$(($n+1))
done < <(find “$c” -name VIDEO_TS)

X=0;
while [ $X -lt $n ]; do
cd “${CurrD[$X]}”
echo $PWD
for f in *.VOB ; do ffmpeg -i “$f” -b:v 3000k -b:a 128k -tag:v DIVX “${f%.VOB}.avi”; done
X=$(($X + 1))
done

Bash script for converting multiple DVD folders in avi/DiVX/XVID was last modified: August 29th, 2019 by Jovan Stosic

Clonezilla – How to copy larger to smaller disk

1) Boot in Ubutu live cd and start gparted.
2) Shrink the source disk’s data partition (e.g. sdb2). From the free space create a new partition (e.g. sdb4).
3) On destination disk create sda1, sda2 and sda3 (swap) with same size and type as in original disk. From the free space create sda4 (smaller than sdb4).
4) Boot in Conezilla.
5) Chose beginer, disk to disk and copy partition to partition (sdb1 to sda1, sdb2 to sda2). Skip the sdb4.

Clonezilla – How to copy larger to smaller disk was last modified: August 21st, 2019 by Jovan Stosic

Interval (music)

The table shows the most widely used conventional names for the intervals between the notes of a chromatic scale. A perfect unison (also known as perfect prime)[5] is an interval formed by two identical notes. Its size is zero cents. A semitone is any interval between two adjacent notes in a chromatic scale, a whole tone is an interval spanning two semitones (for example, a major second), and a tritone is an interval spanning three tones, or six semitones (for example, an augmented fourth).[a] Rarely, the term ditone is also used to indicate an interval spanning two whole tones (for example, a major third), or more strictly as a synonym of major third.

Intervals with different names may span the same number of semitones, and may even have the same width. For instance, the interval from D to F is a major third, while that from D to G is a diminished fourth. However, they both span 4 semitones. If the instrument is tuned so that the 12 notes of the chromatic scale are equally spaced (as in equal temperament), these intervals also have the same width. Namely, all semitones have a width of 100 cents, and all intervals spanning 4 semitones are 400 cents wide.

The names listed here cannot be determined by counting semitones alone. The rules to determine them are explained below. Other names, determined with different naming conventions, are listed in a separate section. Intervals smaller than one semitone (commas or microtones) and larger than one octave (compound intervals) are introduced below.

Number of
semitones
Minor, major,
or perfect
intervals
Short Augmented or
diminished
intervals
Short Widely used
alternative names
Short Audio
0 Perfect unison P1 Diminished second d2 About this soundPlay 
1 Minor second m2 Augmented unison[5][b] A1 Semitone, half tone, half step S About this soundPlay 
2 Major second M2 Diminished third d3 Tone, whole tone, whole step T About this soundPlay 
3 Minor third m3 Augmented second A2 About this soundPlay 
4 Major third M3 Diminished fourth d4 About this soundPlay 
5 Perfect fourth P4 Augmented third A3 About this soundPlay 
6 Diminished fifth d5 Tritone TT About this soundPlay 
Augmented fourth A4
7 Perfect fifth P5 Diminished sixth d6 About this soundPlay 
8 Minor sixth m6 Augmented fifth A5 About this soundPlay 
9 Major sixth M6 Diminished seventh d7 About this soundPlay 
10 Minor seventh m7 Augmented sixth A6 About this soundPlay 
11 Major seventh M7 Diminished octave d8 About this soundPlay 
12 Perfect octave P8 Augmented seventh A7 About this soundPlay 

Source: Interval (music) – Wikipedia

Interval (music) was last modified: August 9th, 2019 by Jovan Stosic