[nflug] Help needed Initializing a new notebook disk drive

Joe josephj at main.nc.us
Sat Jan 3 15:23:39 EST 2009


I was thinking along those lines, but hoped to duck the "giant hand" by
writing a script with something like:

#!/bin/bash
if [ ! -e /media/data/testfile ]
then
   pmount /media/data
   if [ $? -ne 0 ]
   then
      echo data drive not available
      exit 1
   fi
fi
##run application here

Joe

Cyber Source wrote:
> <snip>What still gets me though is forgetting to manually mount it
> before starting up deluge or other applications that are configured to
> use that drive for storage.</snip>
>
> Here's a little trick I use for my nfs backups and such...
>
> If you create the data point WITHIN the mount point and NOT the mount
> point, then stuff that is going to get written to that data point will
> bitch cause it's not there. In other words, create the mount point
> such as /Data but then have your data written to the directory
> /Data/bigbirdstuff. This way, if /Data is not mounted and your app
> tries to save it's data to /Data/bigbirdstuff, a giant hand will come
> from the back of the pc and slap you in the head, cause the directory
> is NOT there cause /Data is NOT mounted!
>
>
> Joe wrote:
>> That's a bit better than what I had figured out so far.  I know about
>> noauto and user, but I probably would have linked to a script with a
>> pmount in it.
>>
>> What still gets me though is forgetting to manually mount it before
>> starting up deluge or other applications that are configured to use that
>> drive for storage.  If there's no "conditional" automount, then I guess
>> I'll just replace the desktop links to those applications with scripts
>> that check for the mount and mount it if necessary before loading the
>> application.  That's easy enough, but not nearly as elegant as having it
>> automagically done for me by Linux somehow.
>>
>> Joe
>>
>> Cyber Source wrote:
>>  
>>> add the option "noauto" to those partitions and if you want a user to
>>> be able to mount it (i.e. not root), add the option "user". If you
>>> create a link to the mount point on your desktop persay, and you have
>>> added the "user" option, then a simple click on the folder will mount
>>> it, if it's indeed plugged in, if not, it will simply show you the
>>> empty directory.
>>>
>>> Joe wrote:
>>>    
>>>> Most of this comes under the heading of "Fools rush in ...".  I've
>>>> had a
>>>> lot of problems on and off with getting things to mount correctly and
>>>> have just been experimenting.  I will go through all your
>>>> suggestions in
>>>> detail and post further.
>>>>
>>>> Thanks for such a detailed and quick response.
>>>>
>>>> BTW, while we're in the middle of fstab:
>>>>
>>>> Is there a way to tell Linux:  I have this USB disk drive that may or
>>>> may not be plugged in at boot time.  If you find it plugged in, I want
>>>> you to mount it here.  But, if it's not plugged in, don't do anything
>>>> and don't complain that you can't find it.
>>>>
>>>> This probably has something to do with hal.  I am currently having
>>>> some
>>>> disagreements with "him", but will not post further on that until I
>>>> clear up all the issues you have already raised.
>>>>
>>>> Joe
>>>>
>>>> Cyber Source wrote:
>>>>  
>>>>      
>>>>> ok, whatever this is....<snip># -- This file has been automaticly
>>>>> generated by *"ntfs-config*" --</snip>, doesnt know what it's doing
>>>>> with your fstab file. What did this and why would it?
>>>>>
>>>>> 1. Your options for your root mount have many redundancies. The
>>>>> options for "nouser, atime" are default options for ext3 and don't
>>>>> need to be specified. The options for "rw, suid, exec, auto, nouser"
>>>>> are declared with the option "defaults", which you already have in
>>>>> there, so those are all redundant.
>>>>> 2. The option "dev" is probably screwing with your udev system and
>>>>> should be taken out.
>>>>> 3. The ONLY options you should have for your / is
>>>>> "relatime,errors=remount-ro", that's it.
>>>>> 4. Since whatever wrote this file made so many errors for your root
>>>>> filesystem options, I wouldn't trust the blkid's either. Verify your
>>>>> blkid's and make sure your mounts are proper AND that swap is being
>>>>> used. Run "df -h" and make sure root is right and then "dmesg|grep
>>>>> swap" to make sure swap is really being used.
>>>>> 5. Check the file /etc/initramfs/conf.d/resume and make sure the swap
>>>>> partitions blkid is correct, if not, change it then run
>>>>> "update-initramfs -u -k all".
>>>>> 6. Check your blkid's with this "sudo blkid /dev/sda4", and so on.
>>>>> 7. I have only ever used the option "defaults" for ntfs-3g and it
>>>>> just
>>>>> works. I could see a reason for the umask option but not the rest.
>>>>> The
>>>>> umask=0002 is going to mount the system 775 for everybody so I really
>>>>> don't see the need for the gid= setting and the others are redundant.
>>>>>  So, I would clean up the options for the ext3 and ntfs-3g partitions
>>>>> and maybe udev would start acting properly. If you need to have the
>>>>> usb stuff declared for directory mounts, that's fine but you need to
>>>>> verify the blkids and clean up the options. Remember, fstab consists
>>>>> of 6 fields separated by white space. The first 4 are required, the
>>>>> other 2, if missing, assume 0. The fifth is only used by dump, so if
>>>>> your not using dump, a zero should at least be put there so that the
>>>>> 6th field is present, which is used by fsck. If you don't want the
>>>>> file system checked on boot, put a zero here (which will be
>>>>> assumed if
>>>>> missing). I would always have / with a 1 (will check and with first
>>>>> priority) and if you want any other partitions checked on boot, give
>>>>> them all a 2.
>>>>>
>>>>>
>>>>> Also, udev should be at work for all your usb stuff, why are you
>>>>> declaring your usb partitions in fstab?
>>>>>
>>>>> Joe wrote:
>>>>>           
>>>>>> /dev/sdc only appears when the drive is plugged in, so I don't think
>>>>>> that's it.
>>>>>> fstab below:
>>>>>>
>>>>>> Joe
>>>>>>
>>>>>> bigbird at sananda:~$ cat /etc/fstab
>>>>>> # /etc/fstab: static file system information.
>>>>>> #
>>>>>> #  -- This file has been automaticly generated by ntfs-config --
>>>>>> #
>>>>>> # <file system> <mount point>   <type>  <options>       <dump> 
>>>>>> <pass>
>>>>>>
>>>>>> proc /proc proc defaults 0 0
>>>>>> # Entry for /dev/sda4 :
>>>>>> UUID=c171912f-5148-41b9-a2e3-70a68361cc57 / ext3
>>>>>> nouser,defaults,errors=remount-ro,atime,auto,rw,dev,exec,suid 0 1
>>>>>> # Entry for /dev/sda6 :
>>>>>> UUID=0deaaf4c-bacb-4644-a3f1-96c46c1b8844 none swap sw 0 0
>>>>>> /dev/scd0 /media/cdrom0 udf,iso9660
>>>>>> user,atime,noauto,rw,dev,exec,suid 0 0
>>>>>> /dev/sda1 /media/windoze ntfs-3g
>>>>>> auto,rw,gid=1002,umask=0002,locale=en_US.utf8 0 0
>>>>>> # Entry for /dev/sda2 :
>>>>>> UUID=5f8bb6e5-f6f7-486e-97aa-06fd6dc3dbfd /media/dataspace ext3
>>>>>> nouser,defaults,atime,auto,rw,dev,exec,suid 0 0
>>>>>> #Entry for /dev/sdb2 - joelinusb2 usb Linux partition
>>>>>> UUID=290fdbe2-4535-4b43-a035-7805062cb069 /media/joelinusb2 ext3
>>>>>> user,async,atime,noauto,rw,dev,exec,suid 0 0
>>>>>> # Entry for /dev/sdb1 - joewinusb usb drive Windows partition
>>>>>> UUID=0BDD76C77F0F8CEE /media/joewinusb ntfs-3g
>>>>>> user,noauto,rw,gid=1002,umask=0002,locale=en_US.utf8 0 0
>>>>>>
>>>>>> bigbird at sananda:~$  Cyber Source wrote:
>>>>>>  
>>>>>>               
>>>>>>> whats in your fstab file? what are the chances that your dvd/cd is
>>>>>>> actually sdc and it's not seeing the new drive at all?
>>>>>>>
>>>>>>> Joe wrote:
>>>>>>>                      
>>>>>>>> Here's the output for dmesg and fdisk.  dmesg shows how it
>>>>>>>> handles my
>>>>>>>> internal drive (sda) and my FreeAgent USB drive (sdb2) (bought it
>>>>>>>> before
>>>>>>>> the article about Seagate dropping support for Linux).  The
>>>>>>>> last two
>>>>>>>> lines show it sees sdc, but fdisk isn't having any.
>>>>>>>>
>>>>>>>> Do you know if a 1.5 MB/sec controller can handle a 3MB/sec drive?
>>>>>>>>
>>>>>>>> Thanks for looking into this further.
>>>>>>>>
>>>>>>>> Joe
>>>>>>>>
>>>>>>>> bigbird at sananda:~$ sudo fdisk /dev/sdc
>>>>>>>>
>>>>>>>> Unable to read /dev/sdc
>>>>>>>> bigbird at sananda:~$
>>>>>>>> bigbird at sananda:~$ dmesg | grep sd
>>>>>>>> [   31.978128] Driver 'sd' needs updating - please use bus_type
>>>>>>>> methods
>>>>>>>> [   31.981229] sd 1:0:0:0: [sda] 234441648 512-byte hardware
>>>>>>>> sectors
>>>>>>>> (120034 MB)
>>>>>>>> [   31.981257] sd 1:0:0:0: [sda] Write Protect is off
>>>>>>>> [   31.981263] sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00
>>>>>>>> [   31.981300] sd 1:0:0:0: [sda] Write cache: enabled, read cache:
>>>>>>>> enabled, doesn't support DPO or FUA
>>>>>>>> [   31.981400] sd 1:0:0:0: [sda] 234441648 512-byte hardware
>>>>>>>> sectors
>>>>>>>> (120034 MB)
>>>>>>>> [   31.981424] sd 1:0:0:0: [sda] Write Protect is off
>>>>>>>> [   31.981429] sd 1:0:0:0: [sda] Mode Sense: 00 3a 00 00
>>>>>>>> [   31.981467] sd 1:0:0:0: [sda] Write cache: enabled, read cache:
>>>>>>>> enabled, doesn't support DPO or FUA
>>>>>>>> [   31.981474]  sda: sda1 sda2 sda3 < sda5 > sda4
>>>>>>>> [   32.027345] sd 1:0:0:0: [sda] Attached SCSI disk
>>>>>>>> [   32.036425] sd 1:0:0:0: Attached scsi generic sg0 type 0
>>>>>>>> [   34.959860] sd 0:0:0:0: [sdb] 488397168 512-byte hardware
>>>>>>>> sectors
>>>>>>>> (250059 MB)
>>>>>>>> [   34.961470] sd 0:0:0:0: [sdb] Write Protect is off
>>>>>>>> [   34.961479] sd 0:0:0:0: [sdb] Mode Sense: 1c 00 00 00
>>>>>>>> [   34.961485] sd 0:0:0:0: [sdb] Assuming drive cache: write
>>>>>>>> through
>>>>>>>> [   34.963859] sd 0:0:0:0: [sdb] 488397168 512-byte hardware
>>>>>>>> sectors
>>>>>>>> (250059 MB)
>>>>>>>> [   34.965465] sd 0:0:0:0: [sdb] Write Protect is off
>>>>>>>> [   34.965474] sd 0:0:0:0: [sdb] Mode Sense: 1c 00 00 00
>>>>>>>> [   34.965479] sd 0:0:0:0: [sdb] Assuming drive cache: write
>>>>>>>> through
>>>>>>>> [   34.965491]  sdb: sdb1 sdb2
>>>>>>>> [   34.991407] sd 0:0:0:0: [sdb] Attached SCSI disk
>>>>>>>> [   34.991485] sd 0:0:0:0: Attached scsi generic sg2 type 0
>>>>>>>> [   53.533600] sdhci: Secure Digital Host Controller Interface
>>>>>>>> driver
>>>>>>>> [   53.533608] sdhci: Copyright(c) Pierre Ossman
>>>>>>>> [   57.853803] sdhci: SDHCI controller found at 0000:08:06.3
>>>>>>>> [104c:803c]
>>>>>>>> (rev 0)
>>>>>>>> [   58.885622] Adding 1767076k swap on /dev/sda5.  Priority:-1
>>>>>>>> extents:1
>>>>>>>> across:1767076k
>>>>>>>> [   59.407078] EXT3 FS on sda4, internal journal
>>>>>>>> [   60.965326] EXT3 FS on sda2, internal journal
>>>>>>>> [   65.379312] audit(1230746295.196:2): type=1503
>>>>>>>> operation="inode_permission" requested_mask="a::"
>>>>>>>> denied_mask="a::"
>>>>>>>> name="/dev/tty" pid=5709 profile="/usr/sbin/cupsd"
>>>>>>>> namespace="default"
>>>>>>>> [  159.538730] EXT3 FS on sdb2, internal journal
>>>>>>>> [ 3994.249820] sd 7:0:0:0: [sdc] Attached SCSI disk
>>>>>>>> [ 3994.249909] sd 7:0:0:0: Attached scsi generic sg3 type 0
>>>>>>>> bigbird at sananda:~$                  Cyber Source wrote:
>>>>>>>>  
>>>>>>>>                            
>>>>>>>>> what does "dmesg|grep sd" return?
>>>>>>>>>
>>>>>>>>> Joe wrote:
>>>>>>>>>                                     
>>>>>>>>>> Thanks for the quick reply.
>>>>>>>>>>
>>>>>>>>>> I did it and the drive shows up as /dev/sdc now (my other usb
>>>>>>>>>> drive is
>>>>>>>>>> plugged in and is /dev/sdb).
>>>>>>>>>> *But* fdisk doesn't seem to see the new drive (see below).
>>>>>>>>>>
>>>>>>>>>> What now?
>>>>>>>>>>
>>>>>>>>>> Joe
>>>>>>>>>>
>>>>>>>>>> bigbird at sananda:~/pq$ ls /dev/sd*
>>>>>>>>>> /dev/sda  /dev/sda1  /dev/sda2  /dev/sda3  /dev/sda4  /dev/sda5
>>>>>>>>>> /dev/sdb  /dev/sdb1  /dev/sdb2  /dev/sdc
>>>>>>>>>> bigbird at sananda:~/pq$ fdisk -l
>>>>>>>>>> bigbird at sananda:~/pq$ sudo !!
>>>>>>>>>> sudo fdisk -l
>>>>>>>>>> [sudo] password for bigbird:
>>>>>>>>>>
>>>>>>>>>> Disk /dev/sda: 120.0 GB, 120034123776 bytes
>>>>>>>>>> 255 heads, 63 sectors/track, 14593 cylinders
>>>>>>>>>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>>>>>>>>> Disk identifier: 0x1ea71ea6
>>>>>>>>>>
>>>>>>>>>>    Device Boot      Start         End      Blocks   Id  System
>>>>>>>>>> /dev/sda1   *           1        5099    40957686    7 
>>>>>>>>>> HPFS/NTFS
>>>>>>>>>> /dev/sda2            5100        8986    31222327+  83  Linux
>>>>>>>>>> /dev/sda3           14000       14219     1767150    5  Extended
>>>>>>>>>> /dev/sda4            8987       13999    40266922+  83  Linux
>>>>>>>>>> /dev/sda5           14000       14219     1767087   82  Linux
>>>>>>>>>> swap /
>>>>>>>>>> Solaris
>>>>>>>>>>
>>>>>>>>>> Partition table entries are not in disk order
>>>>>>>>>>
>>>>>>>>>> Disk /dev/sdb: 250.0 GB, 250059350016 bytes
>>>>>>>>>> 255 heads, 63 sectors/track, 30401 cylinders
>>>>>>>>>> Units = cylinders of 16065 * 512 = 8225280 bytes
>>>>>>>>>> Disk identifier: 0x000979ea
>>>>>>>>>>
>>>>>>>>>>    Device Boot      Start         End      Blocks   Id  System
>>>>>>>>>> /dev/sdb1               1        6384    51279448+   7 
>>>>>>>>>> HPFS/NTFS
>>>>>>>>>> /dev/sdb2            6385       30401   192916552+  83  Linux
>>>>>>>>>> bigbird at sananda:~/pq$
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Cyber Source wrote:
>>>>>>>>>>  
>>>>>>>>>>                                             
>>>>>>>>>>> The gparted cd probably does not have the usb storage module
>>>>>>>>>>> loaded.
>>>>>>>>>>> Boot the laptop with kbuntu, then plug it in. as root, type
>>>>>>>>>>> "fdisk
>>>>>>>>>>> -l", if it sees the drive, there's nothing wrong.
>>>>>>>>>>>
>>>>>>>>>>> Joe wrote:
>>>>>>>>>>>                                                        
>>>>>>>>>>>> I just got a new drive for my notebook.  The old drive still
>>>>>>>>>>>> works,
>>>>>>>>>>>> but
>>>>>>>>>>>> has some bad spots on it (that are out of the way for now).
>>>>>>>>>>>>
>>>>>>>>>>>> The notebook is an HP dv5020us Centrino Duo.  It is dual boot
>>>>>>>>>>>> kubuntu
>>>>>>>>>>>> hardy and Win XP.
>>>>>>>>>>>>
>>>>>>>>>>>> The new HD is Hitachi HTS543232L9A300 5400rpm SATA 320GB 3GB/s
>>>>>>>>>>>> drive.
>>>>>>>>>>>> I thought I ordered a 1.5 GB/s drive, but that's not what the
>>>>>>>>>>>> label on
>>>>>>>>>>>> the drive says.
>>>>>>>>>>>> My old (current) drive (/dev/sda) is a 120GB 1.5GB/s drive
>>>>>>>>>>>> (ST9120821AS)
>>>>>>>>>>>> ATA-5 4200rpm and my controller is probably a 1.5GB/s
>>>>>>>>>>>> controller.
>>>>>>>>>>>>
>>>>>>>>>>>> Is that enough to make the new drive incompatible with my
>>>>>>>>>>>> system?
>>>>>>>>>>>>
>>>>>>>>>>>> I hooked up the drive to my notebook using a Vantec
>>>>>>>>>>>> SATA/IDE to
>>>>>>>>>>>> USB
>>>>>>>>>>>> 2.0
>>>>>>>>>>>> adapter.
>>>>>>>>>>>>
>>>>>>>>>>>> When I plug it into the usb port, nothing seems to happen, but
>>>>>>>>>>>> when I
>>>>>>>>>>>> look, I see that /dev/sdb appears when the drive is plugged
>>>>>>>>>>>> in.  the
>>>>>>>>>>>> drive is very quiet, but I can hear it spinning when I put it
>>>>>>>>>>>> next
>>>>>>>>>>>> to my
>>>>>>>>>>>> ear.
>>>>>>>>>>>>
>>>>>>>>>>>> I rebooted the notebook from my gparted live CD.
>>>>>>>>>>>> I expected gparted to be able to see and setup the new drive,
>>>>>>>>>>>> but it
>>>>>>>>>>>> does not see it at all.
>>>>>>>>>>>>
>>>>>>>>>>>> I thought about swapping the new and old drive in the
>>>>>>>>>>>> notebook and
>>>>>>>>>>>> then
>>>>>>>>>>>> booting from gparted again, but since gparted can see and work
>>>>>>>>>>>> with my
>>>>>>>>>>>> other usb drive (currently unplugged), I'm not sure if that
>>>>>>>>>>>> will
>>>>>>>>>>>> help.
>>>>>>>>>>>>
>>>>>>>>>>>> What do I do next?
>>>>>>>>>>>>
>>>>>>>>>>>> I have a blinking rebate to send in right away, so I need to
>>>>>>>>>>>> determine
>>>>>>>>>>>> if the drive will work asap.
>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>> nflug mailing list
>>>>>>>>>>>> nflug at nflug.org
>>>>>>>>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>>>>>>>>                                                  
>>>>>>>>>>>>                       
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> nflug mailing list
>>>>>>>>>>> nflug at nflug.org
>>>>>>>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>>>>>>>
>>>>>>>>>>>                                                             
>>>>>>>>>> _______________________________________________
>>>>>>>>>> nflug mailing list
>>>>>>>>>> nflug at nflug.org
>>>>>>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>>>>>>                                                   
>>>>>>>>> _______________________________________________
>>>>>>>>> nflug mailing list
>>>>>>>>> nflug at nflug.org
>>>>>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>>>>>
>>>>>>>>>                                         
>>>>>>>> _______________________________________________
>>>>>>>> nflug mailing list
>>>>>>>> nflug at nflug.org
>>>>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>>>>                                 
>>>>>>> _______________________________________________
>>>>>>> nflug mailing list
>>>>>>> nflug at nflug.org
>>>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>>>
>>>>>>>                         
>>>>>> _______________________________________________
>>>>>> nflug mailing list
>>>>>> nflug at nflug.org
>>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>>                   
>>>>> _______________________________________________
>>>>> nflug mailing list
>>>>> nflug at nflug.org
>>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>>
>>>>>             
>>>> _______________________________________________
>>>> nflug mailing list
>>>> nflug at nflug.org
>>>> http://www.nflug.org/mailman/listinfo/nflug
>>>>         
>>> _______________________________________________
>>> nflug mailing list
>>> nflug at nflug.org
>>> http://www.nflug.org/mailman/listinfo/nflug
>>>
>>>     
>>
>> _______________________________________________
>> nflug mailing list
>> nflug at nflug.org
>> http://www.nflug.org/mailman/listinfo/nflug
>>   
> _______________________________________________
> nflug mailing list
> nflug at nflug.org
> http://www.nflug.org/mailman/listinfo/nflug
>




More information about the nflug mailing list