943,708 Members | Top Members by Rank

Ad:
Jul 16th, 2009
0

Unmounting portable HDD

Expand Post »
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
Similar Threads
Reputation Points: 7
Solved Threads: 2
Junior Poster
HLA91 is offline Offline
177 posts
since Oct 2006
Jul 16th, 2009
0

Re: Unmounting portable HDD

Sorry forgot to mention its Ubuntu 9.04
Reputation Points: 7
Solved Threads: 2
Junior Poster
HLA91 is offline Offline
177 posts
since Oct 2006
Jul 20th, 2009
-1

Re: Unmounting portable HDD

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.
Reputation Points: 85
Solved Threads: 64
Practically a Master Poster
sillyboy is offline Offline
686 posts
since Mar 2007
Jul 21st, 2009
0

Re: Unmounting portable HDD

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
Reputation Points: 7
Solved Threads: 2
Junior Poster
HLA91 is offline Offline
177 posts
since Oct 2006

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Kernel and Hardware Setup Forum Timeline: Kernal based project
Next Thread in Linux Kernel and Hardware Setup Forum Timeline: Read and write of memory mapped address





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC