Unmounting portable HDD

Thread Solved

Join Date: Oct 2006
Posts: 179
Reputation: HLA91 is an unknown quantity at this point 
Solved Threads: 2
HLA91 HLA91 is offline Offline
Junior Poster

Unmounting portable HDD

 
0
  #1
Jul 16th, 2009
Hi all

I just bought an external 60GB HDD I cant say what brand name as it doesn't have one written on it.
I know there are problems unmounting HDD's and then they do not spin down and I am having the same problem.
It is in /dev/sdc and the ntfs partition is in sdc1
I mount it in /media/portablehdd
I have tried the following script to unmount and spindown the drive and the script runs but the drive remains on with lights and spinning.

#!/bin/sh
pumount /dev/sdc1
#wait for mtab to be updated
sleep 3
#we search an occurency of our harddrive in mtab
UMOUNT=`grep '/dev/sdc1' /etc/mtab | wc -c`
if [ $UMOUNT -eq 0 ]
then
   #we sync the harddrive
   sdparm --command=sync /dev/sdc1
   #we can spindown the hardrive
   sdparm --command=stop /dev/sdc1
   zenity --info --title="Info" --text="You can unplug your Hardrive !"
else
   zenity --error --title="Info" --text="It seems your harddrive isn't unmounted , unmount it then try again"
fi
But the drive still keeps spinning. Can someone please help me as I am getting worried about just pulling the drive out and possibly losing data.


Many thanks

HLA91
You know your a geek, if you introduce your wife as "mylady@home.wife"
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 179
Reputation: HLA91 is an unknown quantity at this point 
Solved Threads: 2
HLA91 HLA91 is offline Offline
Junior Poster

Re: Unmounting portable HDD

 
0
  #2
Jul 16th, 2009
Sorry forgot to mention its Ubuntu 9.04
You know your a geek, if you introduce your wife as "mylady@home.wife"
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 686
Reputation: sillyboy is on a distinguished road 
Solved Threads: 61
sillyboy's Avatar
sillyboy sillyboy is offline Offline
Practically a Master Poster

Re: Unmounting portable HDD

 
0
  #3
Jul 20th, 2009
assuming this is desktop edition, there should be an eject icon next to the device in the file explorer (can't remember what it is called). whenever i used my portable hdd with ubuntu 9.04 i used this, and it hasn't lost data.

hope that helps.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 179
Reputation: HLA91 is an unknown quantity at this point 
Solved Threads: 2
HLA91 HLA91 is offline Offline
Junior Poster

Re: Unmounting portable HDD

 
0
  #4
Jul 21st, 2009
Ok thanks, I was just worried as it wasn't spinning down but I just tried it on Win XP and it still doesn't spin down after 'safely removing' it. It only stops spinning once you unplug it.

Cheers

HLA91
You know your a geek, if you introduce your wife as "mylady@home.wife"
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the *nix Hardware Configuration Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC