- #!/bin/bash
- cylinders=$(fdisk -l |grep cylinders | awk '{print $8}' | head -n 1)
- real_cylind=$(($cylinders - 1))
- echo $cylinders
- echo $real_cylind
-
fdisk /dev/sda <
- n
- p
- 1
- 2048
- 10487807
- a
- 1
- n
- p
- 2
- 10487808
- 77596671
- t
- 2
- 82
- n
- p
- 3
- 77596672
- $[real_cylind]
- w
- EOF