Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1918 connectés 

  FORUM HardWare.fr
  Linux et OS Alternatifs

  arret disque dur avant l'arret du portable

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

arret disque dur avant l'arret du portable

n°457246
fns158
Posté le 16-04-2004 à 12:43:33  profilanswer
 

J'ai un pb avec mon portable, le disque dur s'arrete en meme temps que s'arrete la machine et alors le disque dur parque les tetes en urgence, ce qui fait un bruit désagreable et aussi diminue sa durée de vie. J'ai une mandrake 10. Quelqu'un sait t'il comment faire ?

mood
Publicité
Posté le 16-04-2004 à 12:43:33  profilanswer
 

n°457267
Dark_Schne​ider
Close the World, Open the Net
Posté le 16-04-2004 à 12:58:50  profilanswer
 

hdparm -Y ?


Message édité par Dark_Schneider le 16-04-2004 à 12:58:59

---------------
Mandriva : parce que nous le valons bien ! http://linux-wizard.net/index.php
n°457276
fns158
Posté le 16-04-2004 à 13:02:29  profilanswer
 

J'ai deja poster sur linuxfr http://linuxfr.org/~fns158/11509.html j'ai eu un debut de reponse mais plus rien apres, c'est pourquoi je retente ma chance ici.

n°457762
fns158
Posté le 16-04-2004 à 18:45:11  profilanswer
 

personne ?

n°459120
fns158
Posté le 19-04-2004 à 13:27:27  profilanswer
 

Pas de reponse ?

n°459133
yannigperr
Posté le 19-04-2004 à 13:47:20  profilanswer
 

A propos du post sur Linuxfr, la solution semblait de rajouter un sync. Cette commande vide les buffers en écriture du système en procédant à l'écriture sur les disques. Ca permet ainsi d'être sûr qu'à ce moment là, tu n'auras plus à redémarrer ton disque pour inscrire des infos.
Tu peux mettre le contenu de ton fichier halt ?


Message édité par yannigperr le 19-04-2004 à 13:47:45
n°459148
fns158
Posté le 19-04-2004 à 14:08:08  profilanswer
 

#!/bin/bash
#
# halt          This file is executed by init when it goes into runlevel
#               0 (halt) or runlevel 6 (reboot). It kills all processes,
#               unmounts file systems and then either halts or reboots.
#
# Author:       Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
#               Modified for RHS Linux by Damien Neil
#
 
NOLOCALE=1
. /etc/init.d/functions
 
runcmd() {
   echo -n "$1 "
   shift
   if [ "$BOOTUP" = "color" ]; then
      $* && echo_success || echo_failure
   else
      $*
   fi
   echo
}
 
halt_get_remaining() {
 awk '$2 ~ /^\/$|^\/proc|^\/dev/{next}
      $3 == "tmpfs" || $3 == "proc" {print $2 ; next}
      /(^#|loopfs|autofs|devfs|^none|^\/dev\/root)/ {next}
      {print $2}' /proc/mounts
}
 
# See how we were called.
case "$0" in
   *halt)
 message=`gprintf "Halting system..."`
 command="/sbin/halt"
 ;;
   *reboot)
 message=`gprintf "Please stand by while rebooting the system..."`
 command="/sbin/reboot"
 ;;
   *)
 gprintf "%s: call me as 'halt' or 'reboot' please!\n" $0
 exit 1
 ;;
esac
 
case "$1" in
   *start)
    ;;
   *)
 gprintf "Usage: %s\n" "$(basename $0) {start}"
 exit 1
 ;;
esac
 
# Recreate the /initrd if needed
if [ ! -d /initrd ]; then
    runcmd "Creating initrd directory" mkdir /initrd
fi
if [ -d /initrd -a ! -f /initrd/README.WARNING ]; then
    cat > /initrd/README.WARNING <<EOF
(mkinitrd) Don't remove this directory, it's needed at boot time,
in the initrd, to perform the pivot_root.
EOF
fi
 
# Kill all processes.
[ "${BASH+bash}" = bash ] && enable kill
 
runcmd "Sending all processes the TERM signal..." /sbin/killall5 -15
sleep 5
runcmd "Sending all processes the KILL signal..."  /sbin/killall5 -9
 
# Write to wtmp file before unmounting /var
/sbin/halt -w
 
# Sync the system clock.
ARC=0
SRM=0
UTC=0
 
if [ -f /etc/sysconfig/clock ]; then
   . /etc/sysconfig/clock
 
   # convert old style clock config to new values
   if [ "${CLOCKMODE}" = "GMT" ]; then
      UTC=true
   elif [ "${CLOCKMODE}" = "ARC" ]; then
      ARC=true
   fi
fi
 
CLOCKDEF=""
CLOCKFLAGS="$CLOCKFLAGS --systohc"
 
case "$UTC" in
   yes|true)
 CLOCKFLAGS="$CLOCKFLAGS -u";
 CLOCKDEF="$CLOCKDEF (utc)";
 ;;
   no|false)
 CLOCKFLAGS="$CLOCKFLAGS --localtime";
 CLOCKDEF="$CLOCKDEF (localtime)";
 ;;
esac
 
case "$ARC" in
   yes|true)
 CLOCKFLAGS="$CLOCKFLAGS -A";
 CLOCKDEF="$CLOCKDEF (arc)";
 ;;
esac
case "$SRM" in
   yes|true)
 CLOCKFLAGS="$CLOCKFLAGS -S";
 CLOCKDEF="$CLOCKDEF (srm)";
 ;;
esac
 
runcmd "Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
 
# Turn off swap, then unmount file systems.
SWAPS=`awk '! /^Filename/ { print $1 }' /proc/swaps`
[ -n "$SWAPS" ] && runcmd "Turning off swap: " swapoff $SWAPS
 
[ -x /sbin/quotaoff ] && runcmd "Turning off quotas: " /sbin/quotaoff -aug
 
# first remove entry /initrd/loopfs as it can't be unmounted :(
mtab=$(fgrep -v "/initrd/loopfs[^/]" /etc/mtab)
(IFS= ; echo $mtab > /etc/mtab)
 
# Unmount file systems, killing processes if we have to.
# Unmount loopback stuff first
remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts`
devremaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts`
[ -n "$remaining" ] && {
 sig=
 retry=3
 while [ -n "$remaining" -a "$retry" -gt 0 ]
 do
  if [ "$retry" -lt 3 ]; then
   runcmd "Unmounting loopback filesystems (retry):" umount $remaining
  else
   runcmd "Unmounting loopback filesystems: " umount $remaining
  fi
  for dev in $devremaining ; do
   losetup $dev > /dev/null 2>&1 && \
    runcmd "Detaching loopback device %s: " $dev losetup -d $dev
  done
  remaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $2}' /proc/mounts`
  devremaining=`awk '!/^#/ && $1 ~ /^\/dev\/loop/ && $2 != "/" {print $1}' /proc/mounts`
  [ -z "$remaining" ] && break
  /sbin/fuser -k -m $sig $remaining >/dev/null
  sleep 5
  retry=$(($retry -1))
  sig=-9
 done
}
 
sig=
retry=3
remaining=`halt_get_remaining | sort -r`
 
while [ -n "$remaining" -a "$retry" -gt 0 ]
do
 if [ "$retry" -lt 3 ]; then
  LC_ALL=C runcmd "Unmounting file systems (retry): "  umount -f $remaining
 else
  LC_ALL=C runcmd "Unmounting file systems: "  umount -f $remaining
 fi
 sleep 2
 remaining=`halt_get_remaining | sort -r`
 [ -z "$remaining" ] && break
 /sbin/fuser -k -m $sig $remaining >/dev/null
 sleep 5
 retry=$(($retry-1))
 sig=-9
done
 
if [ -f /etc/lvm/lvm.conf -a -x /sbin/lvm2 ]; then
 if grep -q -s 'device-mapper' /proc/devices; then
  _vgchange_cmd="/sbin/lvm2 vgchange -a n"
 fi
fi
 
if [ -z "${_vgscan_cmd}" -a -f /etc/lvmtab -a -e /proc/lvm ] ; then
 if [ -x /sbin/lvm1-vgchange ]; then
  _vgchange_cmd="/sbin/lvm1-vgchange -a n"
 elif [ -x /sbin/vgchange ]; then
  _vgchange_cmd="/sbin/vgchange -a n"
 fi
fi
 
if [ -n "${_vgchange_cmd}" ]; then
    runcmd "Shutting down LVM:" ${_vgchange_cmd}
fi
 
[ -f /proc/bus/usb/devices ] && umount /proc/bus/usb
 
# remove the crash indicator flag
rm -f /.autofsck
 
# Try them all, one last time.
umount -a -f -t nodevfs,noproc
 
# Remount read only anything that's left mounted.
#gprintf "Remounting remaining filesystems (if any) readonly\n"
mount | awk '/( \/ |^\/dev\/root)/ { print $3 }' | while read line; do
    mount -n -o ro,remount $line
done
 
runcmd "Unmounting proc file system: " umount /proc
 
 
# See if this is a powerfail situation.
if [ -f /etc/apcupsd/powerfail ]; then
  gprintf "APCUPSD will now power off the UPS!\n"
  echo
  /etc/apcupsd/apccontrol killpower
  echo
  gprintf "Please ensure that the UPS has powered off before rebooting\n"
  gprintf "Otherwise, the UPS may cut the power during the reboot!!!\n"
  echo
  sleep 120
  exit 1
fi
 
# for NUT
if [ -f /etc/init.d/upsd ]; then
    /etc/init.d/upsd powerdown
    [ $? == 3 ] && exit 1
fi
# Now halt or reboot.
echo "$message"
if [ -f /fastboot ]; then
 gprintf "On the next boot fsck will be skipped.\n"
elif [ -f /forcefsck ]; then
 gprintf "On the next boot fsck will be forced.\n"
fi
 
if [ -x /sbin/halt.local ]; then
   /sbin/halt.local
fi
 
HALTARGS="-i -d -p -h"
mount -n -t proc proc /proc
 
exec $command $HALTARGS

n°459167
yannigperr
Posté le 19-04-2004 à 14:29:00  profilanswer
 

Tu n'as qu'à rajouter un 'sync' juste avant la dernière ligne 'exec $command $HALTARGS'.
 
En gros, le -h de HALTARGS va te permettre de dire à chacun de tes disques de se mettre en veille juste avant l'arrêt. Si par malheur un te disques contenait encore des données à écrire, il faudrait qu'il soit reréveillé.

n°459182
fns158
Posté le 19-04-2004 à 15:00:17  profilanswer
 

je viens d'essayer et c'est toujours pareil arret puis redemarrage.
 
Edit : bon sa marche le dd s'arrete bien et ne redemarre pas, merci.


Message édité par fns158 le 19-04-2004 à 17:47:47

Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Linux et OS Alternatifs

  arret disque dur avant l'arret du portable

 

Sujets relatifs
Scandisk d'un disque FAT32 ?Montage d'un disque dur USB
Quel distrib linux pour un portable Armada 450mhz / 128mo RAM ?[Debian 3.0] Installation - disque dur non reconnu
Linux sur un disque dur externe USB ? est-ce possible ???[boot] Problème Grub disque SCSI
Au sujet d'un portable VIAO (sony).desinstaller mdk 9.2 sans formater mon disque
Partitionner mon disque dur pour installer linux et windows xp?[MDK10] Impossible de changer les droits d'un disque en FAT 32[done]
Plus de sujets relatifs à : arret disque dur avant l'arret du portable


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR