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/>.
#
#######




# «.seagate-goflex»		(to "seagate-goflex")
# «.external-hds»		(to "external-hds")
# «.external-hds-sex»		(to "external-hds-sex")
# «.external-hds-reef»		(to "external-hds-reef")
# «.generate_part_of_fstab»	(to "generate_part_of_fstab")


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



#####
#
# Seagate GoFlex
# 2017jun25
#
#####

# «seagate-goflex» (to ".seagate-goflex")

# 2017mai25:
# (find-fline "/proc/scsi/scsi")
# (find-fline "/proc/scsi/scsi" "Seagate  Model: FreeAgent GoFlex")
# Seagate goflex
# (find-fline "/tmp/goflex2/")
# (find-fline "/tmp/goflex2/horses/sda5/books/")
# (find-fline "/tmp/goflex2/CDs/")
# (find-fline "/tmp/goflex2/music/")
# (find-fline "/tmp/goflex2/home/edrx/books/__cats/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mkdir /tmp/goflex1/
mkdir /tmp/goflex2/
sudo mount /dev/sdb1  /tmp/goflex1/
sudo mount /dev/sdb2  /tmp/goflex2/
# (find-fline "/tmp/goflex1/")
# (find-fline "/tmp/goflex2/")
sudo umount /tmp/goflex1/
sudo umount /tmp/goflex2/

# (find-asrootfile "/tmp/goflex2/verena/home/")




#####
#
# My external HDs (2015)
# 2015nov23
#
#####

# «external-hds» (to ".external-hds")
# (find-efunction 'find-hde-links)
# (find-hde-links)

# (find-man "8 mount")

# (find-fline "/etc/passwd")
# (find-fline "/etc/passwd" "user:")
# (find-fline "/etc/passwd" "edrx:")

# «external-hds-sex» (to ".external-hds-sex")
# Samsung external
#
mkdir /tmp/sex1/
mkdir /tmp/sex2/
sudo mount /dev/sdb1  /tmp/sex1/
sudo mount /dev/sdb2  /tmp/sex2/
# (find-fline "/tmp/sex1/")
# (find-fline "/tmp/sex2/")
sudo umount /tmp/sex1/
sudo umount /tmp/sex2/

# (find-fline "/tmp/sex2/horses/home/edrx/NICOTINE/gmail/")

# «external-hds-reef» (to ".external-hds-reef")
# Reef (in case)
#
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mkdir /tmp/reef1/
mkdir /tmp/reef2/
mkdir /tmp/reef5/
mkdir /tmp/reef6/
mkdir /tmp/reef7/
sudo mount /dev/sdb1 /tmp/reef1/
sudo mount /dev/sdb2 /tmp/reef2/
sudo mount /dev/sdb5 /tmp/reef5/
sudo mount /dev/sdb6 /tmp/reef6/
sudo mount /dev/sdb7 /tmp/reef7/
# (find-fline "/tmp/reef1/etc/")
# (find-fline "/tmp/reef1/etc/coletivo_coiote/")
# (find-fline "/tmp/reef1/music/")
# (find-fline "/tmp/reef7/torrents/movies/")
# (find-fline "/tmp/reef7/torrents/music/")
# (find-fline "/tmp/reef7/torrents/etc/")

# (find-fline "/tmp/reef1/")
# (find-fline "/tmp/reef2/")
# (find-fline "/tmp/reef2/.id")
# (find-fline "/tmp/reef2/.files")
# (find-fline "/tmp/reef2/home/edrx/SCANS/")
# (find-fline "/tmp/reef2/lakh3/sda4/CDs/nau/")
# (find-fline "/tmp/reef2/lakh3/sda4/Meredith_Monk/")
# (find-fline "/tmp/reef5/")
# (find-fline "/tmp/reef6/")
# (find-fline "/tmp/reef6/NICOTINE/")
# (find-fline "/home/reef6/NICOTINE/")
# (find-fline "/tmp/reef7/")
# (find-fline "/tmp/reef7/Downloads/MC5 A True Testimonial/")
# (find-fline "/tmp/reef7/snarf/http/www.domai.com/members/")
# (find-fline "/tmp/reef7/nikon/")
# (find-fline "/tmp/reef7/nikon/" "DSC_0033.JPG")
# (find-fline "/tmp/reef7/nikon/" "DSC_0049.JPG")
# (find-fline "/tmp/reef7/torrents/")
# (find-fline "/tmp/reef7/torrents/SLITS/")
# (find-fline "/tmp/reef7/torrents/audios/2011dec13/")
cd
sudo umount /tmp/reef1/
sudo umount /tmp/reef2/
sudo umount /tmp/reef5/
sudo umount /tmp/reef6/
sudo umount /tmp/reef7/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
sudo cp -av /tmp/reef1/music/* /home/music/
sudo cp -av /tmp/reef7/torrents/music/* /home/music/
sudo rm -Rv /tmp/reef7/torrents/music
sudo cp -av /tmp/reef7/torrents/movies/* /home/movies/
sudo rm -Rv /tmp/reef7/torrents/movies

# (find-fline "/tmp/reef1/music/")
# (find-fline "/home/music/")
# (find-fline "/home/movies/")
sudo rm -Rv /tmp/reef1/music/*
sudo rmdir  /tmp/reef1/music/

# (find-fline "/tmp/reef1/music/")
# (find-fline "/tmp/reef7/torrents/movies/")
# (find-fline "/tmp/reef7/torrents/music/")
# (find-fline "/tmp/reef7/torrents/etc/")

sudo rm -Rv /tmp/reef1/movies/
/tmp/reef7/torrents/music





* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
mkdir /tmp/lakh1/
mkdir /tmp/lakh3/
mkdir /tmp/lakh5/
mkdir /tmp/lakh6/
mkdir /tmp/lakh7/
sudo mount -o ro /dev/sdb1 /tmp/lakh1/
sudo mount -o ro /dev/sdb3 /tmp/lakh3/
sudo mount -o ro /dev/sdb5 /tmp/lakh5/
sudo mount -o ro /dev/sdb6 /tmp/lakh6/
sudo mount -o ro /dev/sdb7 /tmp/lakh7/

sudo mount /dev/sdb1 /tmp/lakh1/
sudo mount /dev/sdb3 /tmp/lakh3/
sudo mount /dev/sdb5 /tmp/lakh5/
sudo mount /dev/sdb6 /tmp/lakh6/
sudo mount /dev/sdb7 /tmp/lakh7/
# (find-fline "/tmp/lakh1/")
# (find-fline "/tmp/lakh1/etc/hostname")
# (find-fline "/tmp/lakh1/home/edrx/tmp/")
# (find-fline "/tmp/lakh1/home/edrx/snarf/http/mytattoogirls.com/galleries/content/")
# (find-fline "/tmp/lakh1/home/edrx/FOTOS/")
# (find-fline "/tmp/lakh1/home/edrx/FOTOS/print/")
# (find-fline "/tmp/lakh1/home/edrx/FOTOS/selana/")
# (find-fline "/tmp/lakh1/home/edrx/FOTOS/selana_2014nov/")
# (find-fline "/tmp/lakh3/")
# (find-fline "/tmp/lakh3/sda4/")
# (find-fline "/tmp/lakh3/sda4/audios/")
# (find-fline "/tmp/lakh5/")
# (find-fline "/tmp/lakh6/")
# (find-fline "/tmp/lakh7/")
# (find-fline "/tmp/lakh7/GA/")
# (find-fline "/tmp/lakh7/audios/")
# (find-fline "/tmp/lakh7/coniglio/")
# (find-fline "/tmp/lakh7/torrents7/")
# (find-fline "/tmp/lakh7/videos/")
# (find-fline "/tmp/lakh7/videos/bittersweet/")
# (find-fline "/tmp/lakh7/videos/manifs/")
cd
sudo umount /tmp/lakh1/
sudo umount /tmp/lakh3/
sudo umount /tmp/lakh5/
sudo umount /tmp/lakh6/
sudo umount /tmp/lakh7/






#####
#
# 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: