How can I ban the use of swap partitions? (Solved)
How can I ban the use of swap partitions? (Solved)
Hello,
I use Xenialpup64 for only one script: Hard disk cloning and the following comparison.
Now I have comparison errors and I suspect Xenialpup64 uses the swap partition of the hard drives that are being cloned.
How can I ban the use of swap partitions?
I use Xenialpup64 for only one script: Hard disk cloning and the following comparison.
Now I have comparison errors and I suspect Xenialpup64 uses the swap partition of the hard drives that are being cloned.
How can I ban the use of swap partitions?
Last edited by wawi on Sun 06 May 2018, 17:57, edited 1 time in total.
I do not use the cloned disks intentionally, but use a separate system (Puppy) for cloning. Yes, the swap partition is also cloned to keep it simple. But Puppy loads all swap partitions and probably uses them. The following lines regarding installed hard drives that I can read at boot of Puppy:Flash wrote:So you cloned the hard drive including the swap partition? If you use the cloned hard drive and its swap partition is mounted, the contents of the swap partition might be changed somehow. That would be normal and expected.
Code: Select all
Loading swap partition /dev/sda1 (7.6G)...
Loading swap partition /dev/sdb1 (7.6G)...
Loading swap partition /dev/sdc1 (7.6G)...
on slacko i do
to 'unload' swapfile, where the -a unloads all swaps
Code: Select all
swapoff -a
Code: Select all
# swapoff --help
Usage:
swapoff [options] [<spec>]
Options:
-a, --all disable all swaps from /proc/swaps
-h, --help display help and exit
-v, --verbose verbose mode
-V, --version display version and exit
The <spec> parameter:
-L <label> LABEL of device to be used
-U <uuid> UUID of device to be used
LABEL=<label> LABEL of device to be used
UUID=<uuid> UUID of device to be used
<device> name of device to be used
<file> name of file to be used
Still comparison error!ally wrote:google swapoff
Could be another reason. I have tested with other hard drives and other ports with md5sum. md5sum is stable, but not identical in source and destination disks.
I have used Puppy in an older version for years without any problems, until the USB stick was broken. I loaded the current Puppy and my Legacy script onto a new USB stick. Maybe someone can find the reason:
Code: Select all
#! /bin/bash -e
tail -n +4 $0 > /tmp/script.txt
exec rxvt -e bash /tmp/script.txt
swapoff -a
quelle=/dev/sdb
ziel=/dev/sdc
historyint=/dev/sda
log="/mnt/home/0Backup.Log"
sound="beep -f 400 -n -f 600 -n -f 800 -n -f 400 -n -f 600 -n -f 800"
/sbin/hdparm -B 128 -S 60 $historyint
echo -n "Beenden: e andere Platten: a sonst Anschlusstest Quelle $quelle "
read i
case "$i" in
e) exit;;
a) echo -n "Quelle: "; read quelle
echo -n "Ziel: "; read ziel
echo -n "Anschlusstest Quelle $quelle mit ENTER "
read ;;
esac
error=0
dd if=$quelle of=/dev/null count=100000 || error=1
echo -n "Anschlusstest Ziel $ziel mit ENTER "
read
dd if=$ziel of=/dev/null count=100000 || error=1
if [ "$error" = 0 ]; then
echo -n "Wenn richtige Festplatten: Kopieren mit ENTER oder Abbruch Ctrl c "
read
else
echo -n "Beenden mit ENTER "
read
exit
fi
echo $(date -I;date +%T)" Festplatten werden jetzt kopiert" | tee -a $log
nice -n 19 ionice -c 3 dd if=$quelle of=$ziel bs=4096 2>&1 | tee -a $log
echo $(date -I;date +%T)" Festplatten werden jetzt verglichen" | tee -a $log
nice -n 19 ionice -c 3 cmp $quelle $ziel 2>&1 | tee -a $log
echo $(date -I;date +%T) | tee -a $log
echo "" | tee -a $log
echo "Fertig. Ctrl C, sonst Shutdown in 2 min."
$sound
sleep 60
echo " noch 1 min."
$sound
sleep 60
wmpoweroff
Wait a minute. You're comparing the entire contents of one hard disk drive with those of another, possibly larger or smaller drive? What makes you think the swap partition has anything to do with the md5sum difference? If the two drives are not exactly the same, I would expect a difference in their md5sums.
Comparing the raw hard drives can only work with exact the same numbers of bytes in the two hard drives. It is given.Flash wrote:Wait a minute. You're comparing the entire contents of one hard disk drive with those of another, possibly larger or smaller drive? What makes you think the swap partition has anything to do with the md5sum difference? If the two drives are not exactly the same, I would expect a difference in their md5sums.
Writing of one hard drive in the time of copying or comparing, for example on swap, will make a difference between source and destination.
Repeated tests with md5sum shold test the hardware. Seems to be stable.
The same script woked fine with an older Puppy version over years!
How can I ban the use of swap partitions? (Solved)
The reason for the problem was just a broken RAM. I had to think about it earlier.