Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts on hard disks (partitions, parameters, etc).
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/hd.e>
#           or at <http://angg.twu.net/e/hd.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######




# «.generate_part_of_fstab»	(to "generate_part_of_fstab")


# (find-es "e2fs")
# (find-es "bsd" "bsd_partitions")



#####
#
# util-linux: fdisk, cfdisk, sfdisk
# 2000jul03
#
#####

# (find-status "util-linux")
# (find-vldifile "util-linux.list")
# (find-fline "/usr/doc/util-linux/")
# (find-fline "/usr/doc/util-linux/README.fdisk.gz")
# (find-fline "/usr/doc/util-linux/examples/")
# (find-fline "/usr/doc/util-linux/examples/sfdisk.examples.gz")

# (eeman "8 fdisk")
# (eeman "8 cfdisk")
# (eeman "8 sfdisk")

sfdisk -V /dev/hda	; echo
sfdisk -V /dev/hdc	; echo
sfdisk -V /dev/hdd	; echo

sfdisk -l /dev/hda	; echo
sfdisk -l /dev/hdc	; echo
sfdisk -l /dev/hdd	; echo

fdisk -l /dev/hda
fdisk -l /dev/hdc
fdisk -l /dev/hdd

fdisk
cfdisk
sfdisk

(sfdisk -l /dev/hda
 sfdisk -l /dev/hdc
 sfdisk -l /dev/hdd
) | sort | uniq

# (find-es "console" "kbdrate_setting")

# (code-c-d "ul" "/usr/src/util-linux-2.10f/")
# (find-ulfile "fdisk/")






#####
#
# Prepare part of /etc/fstab automatically
# 2000aug08
#
#####

# «generate_part_of_fstab»  (to ".generate_part_of_fstab")
#*
fdisk -l /dev/hd{a,c,d} | tee /tmp/ofdisk
# (find-fline "/tmp/ofdisk")

grep '^/dev/hd' /tmp/ofdisk \
  | grep -v Extended \
  | tee /tmp/ofdisk2

echo '
# (find-es "hd" "generate_part_of_fstab")
#' > /tmp/fstab
grep 'Linux$' /tmp/ofdisk2 \
  | tr / ' ' \
  | awk '{printf "/dev/%-10s /%-14s ext2    defaults%23s 0 2\n",$2,$2," "}' \
  >> /tmp/fstab
echo '#' >> /tmp/fstab
grep 'Linux swap$' /tmp/ofdisk2 \
  | tr / ' ' \
  | awk '{printf "/dev/%-10s none%12sswap    sw%29s 0 2\n",$2," "," "}' \
  >> /tmp/fstab

#/dev/hda6	/hda6		ext2	defaults			0 2
cat /tmp/fstab
#/dev/hdd7      none            swap    sw                              0 0

# (find-fline "/tmp/fstab")

#*





#####
#
# /proc/partitions
# 2000jul03
#
#####

cat /proc/partitions
cat /proc/partitions | grep '[0-9]$'
cat /proc/partitions | grep '[0-9]$' | grep -v ' 1 hd'






#####
#
# gpart
# 2000jul03
#
#####

# (find-status "gpart")
# (find-vldifile "gpart.list")
# (find-fline "/usr/doc/gpart/")
# (find-fline "/usr/doc/gpart/README.gz")
# (find-fline "/usr/doc/gpart/README.gz" "gpart -v")
# (eeman "8 gpart")




#####
#
# parted
# 2000jul03
#
#####

# (find-status "parted")
# (find-vldifile "parted.list")
# (find-fline "/usr/doc/parted/")

# Error: The partition table on /dev/hda is inconsistent. There are
# many reasons why this might be the case. However, the most likely
# reason is that Linux detected the BIOS geometry for /dev/hda
# incorrectly. GNU Parted suspects the real geometry should be
# 16067/16/63 (not 1008/255/63). You should check with your BIOS
# first, as this may not be correct. You can inform Linux by adding
# the parameter hda=16067,16,63 to the command line. See the LILO
# documentation for more information. If you think Parted's suggested
# geometry is correct, you




#####
#
# marking bad blocks in an ext2 partition
# 2001oct29
#
#####

<T_VoiD> edrx: badblocks or e2fsck -c . you could use a file list from
the sector, but the value has to be divided depending on the block
size I never know, so better create the list with badblocks + e2fsck
-l (or use directly e2fsck -c)

# (find-man "badblocks")
# (find-man "mke2fs" "   -c")
# (find-man "mke2fs" "   -l")
# (find-man "e2fsck" "  -c")


{ UncorrectableError } LBAsect = 2421754, sector 210048 end_request: I/O error



#  Local Variables:
#  coding:               no-conversion
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  ee-charset-indicator: "Ñ"
#  End: