 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

11th June 2008, 09:12 PM
|
|
Registered User
|
|
Join Date: Jun 2008
Posts: 7

|
|
|
Automated Mounting of a SATA Hard drive
Hello all,
I'd like to give you guys a bit of background to give you an idea of what i'm doing, and why i'm doing it.
I work as a computer engineer for a small company. The company is developing a piece of aerial survey equipment. When i was hired, everything was completed, and we were just awaiting some final hardware to do a full test. The original software was written for Windoze. When we went to test, the software package crapped out. We went back to the drawing board on the software, and we then decided to rewrite the package for linux, specifically Fedora Core, because that's what I am familiar with distro wise. I then spent this last winter porting the whole thing, which was pretty much meant a complete rewrite to make it work with linux. Under linux, it performed admirably! Where the windows package approached full processor saturation, even with all the performance tweaks added i could think of to do, the linux setup runs full speed with just 20% of processor load! Yay! A triumph for the open source people, who know how to write efficient and sane code.
Anyways, every linux hurdle that has come my way i've been able to get around except this one.
The data is being logged to an compact flash card, that is connected via a CF/SATA converter box. Basically, to linux, it has a 2 gig hardrive on SATA port 2 kinda thing. I'm using all compact flash because when in flight, especially in windy conditions, there is enough vibration to damage a regular hard drive, or knock out a USB drive connection (the existing USB connections are super glued shut, so they don't vibrate out).
Ideally, i would like the system to be able to auto mount anything CF card i put it that slot to /data, so that the logging software can just dump it's data to it. Then when i land, i shut the system down, pull the flash card, and i'm done. Then i can put a new flash card in next flight, log a bunch more data, lather, rinse repeat Ad-Infinum.
I can format new cards before putting them in (that's acceptable, and can be done in windows, without any special linux style knowledge) , but i don't want to have to add a new fstab line every time i have a new card, or worse, have to talk a tech with no linux knowledge through adding a new fstab line everytime.
I've looked into AutoFS, but i've read a lot of peoples comments on how AutoFS isn't really suitable to SATA drives.
Thanks for any insight you can offer!
-Steve
|

11th June 2008, 09:46 PM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 14

|
|
|
I'm not having any kind of problems with AutoFS it just automatically mounts any sata drive for me..
maybe other more expert users can help you with this
|

11th June 2008, 09:55 PM
|
|
Registered User
|
|
Join Date: Jun 2008
Posts: 7

|
|
|
Do you experience any issues with the drive not mounting every boot? Or it not mounting when you try to write it? Data is the most valuable component of this system. More then the hardware itself.
|

11th June 2008, 10:09 PM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 14

|
|
|
what is the file system of that SATA drive you have?
I didn't experienced any issues with drives uses ntfs or fat32, it just automatically mount with read&write permissions, maybe hfs+ will mount as read only..
|

11th June 2008, 10:12 PM
|
|
Registered User
|
|
Join Date: Jun 2008
Posts: 7

|
|
|
Well, at present, when you put a new card in. Absolutely nothing happens. You boot, it is not mounted. You can mount it by going through manually, but it's a PITA, and not something I can do everything I power on.
EDIT: File type is FAT32
|

11th June 2008, 10:20 PM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 14

|
|
ok you may simply add the command that mounts the SATA drive to:
/etc/conf.d/local.start
and it will be automatically mounted every time you boot
EDIT:
Please check this before trying the previous solution:
http://www.fedoraforum.org/forum/sho...d.php?t=149785
Last edited by bassel.safadi; 11th June 2008 at 10:25 PM.
|

11th June 2008, 10:27 PM
|
|
Registered User
|
|
Join Date: Jun 2008
Posts: 7

|
|
|
Maby that's something to consider. Can i issue a command there that will Generically mount anything that happens to be on the end of SATA cable 2? The mount command i'm currently using points at a unique UUID for mounting purposes.
EDIT: Will /dev/hdb remain stable, even as i effectively swap different hard drives on and off of it? (not while it's running) ?
I thought for some reason that linux would keep track of the hard drives it has seen, and auto increment so that CF disc one would be hdb, and CF disc two would be hdc ?
Last edited by stevey_frac; 11th June 2008 at 10:34 PM.
|

11th June 2008, 10:51 PM
|
|
Registered User
|
|
Join Date: May 2008
Posts: 14

|
|
|
if you have two drives and you keep changing the second drive, the /dev/hdb will remain stable I don't think there is an auto increment thing here..
I don't know if there is some sort of command that will mount any SATA drive, maybe another ( more experienced user ) can help you with this, but the drive letter (if I can call it like that) will remain the same all the time
|

11th June 2008, 11:19 PM
|
|
Registered User
|
|
Join Date: Jun 2008
Posts: 7

|
|
|
so i should just be able to do something akin to mount /t msdos /dev/hdb /data
assuming /data exists, and I have permissions worked out?
This i guess also assumes that the disc is formatted msdos?
Gah, I know my way around windows far better then around linux, despite my distaste for it. Most of my experience with linux, it's just "worked" persay, and i've never had to dig into the nuts and bolts of regular life.
|

12th June 2008, 12:07 AM
|
 |
Registered User
|
|
Join Date: May 2005
Location: NKY
Posts: 106

|
|
Quote:
|
Originally Posted by stevey_frac
so i should just be able to do something akin to mount /t msdos /dev/hdb /data
assuming /data exists, and I have permissions worked out?
This i guess also assumes that the disc is formatted msdos?
Gah, I know my way around windows far better then around linux, despite my distaste for it. Most of my experience with linux, it's just "worked" persay, and i've never had to dig into the nuts and bolts of regular life.
|
im the same way..... i dont learn about something till it doesnt work...
completely self taught regarding linux
here is some reading
http://en.wikipedia.org/wiki/Fstab
http://www.tuxfiles.org/linuxhelp/fstab.html
let us know the outcome
CHEERS
__________________
AMD Athlon 64 3200
Msi K8N Neo4
2 GB dual-channel PC3200
Saphire ATI x600 Pci-e
160GB WD ide
160GB WD sata
500GB WD sata
---F9-x86_64--
|

11th June 2008, 11:38 PM
|
 |
Registered User
|
|
Join Date: Aug 2005
Location: Ann Arbor
Age: 45
Posts: 3,907

|
|
you should be able to "mount /t msdos /dev/hdb /data"
BUT SElinux will through a fit i would use
Code:
mount /t msdos /dev/hdb /mnt/data
by using the /mnt folder to hold the data folder
|

11th June 2008, 11:45 PM
|
 |
Registered User
|
|
Join Date: May 2005
Location: NKY
Posts: 106

|
|
|
easy peasy
just put it in your fstab like so and it will mount at boot time
Code:
/dev/sdb1 /data vfat iocharset=utf8,users,rw,owner,umask=000 0 0
device mountpoint fs-type options
if you dont change # of drives connected to system then this should not change
if mount point /data is good you could have a thousand CF cards and it will mount anything that has a vfat (ie. fat32) partition
the options are what control a vfat partition since it has to set permissions at boot time now
the last couple of zeros tell the kernel not to check-disk this disk on startup
if it is listed in fstab all you have to do is a without rebooting
that will mount all lines in fstab
extra 2 cents
if you want you could write a script that checks the size of the /data folder using the du comand
and informs you if it is full or not mounted
du is disk useage
__________________
AMD Athlon 64 3200
Msi K8N Neo4
2 GB dual-channel PC3200
Saphire ATI x600 Pci-e
160GB WD ide
160GB WD sata
500GB WD sata
---F9-x86_64--
Last edited by wtg_photos; 11th June 2008 at 11:48 PM.
Reason: typo
|

12th June 2008, 02:48 PM
|
 |
Registered User
|
|
Join Date: May 2005
Location: NKY
Posts: 106

|
|
@stevey_frac
i have been messing around with scripts and Zenity (gui for scripts in gnome)
i wrote this one that will tell you info about the size and usage of a DIR
you can make a launcher to run it from the desktop or call it from cmdline
any suggestions are welcome
save as file disk_usage.sh
or similar
then
Code:
chmod a+x disk_usage.sh
Code:
#!/bin/bash
#zenity --info --title="Disk Usage by Folder" --text="If you would like, I can
#check a directory to see what percentage of space they use?"
export TARGET_DIR=`zenity --file-selection --directory`
export VOL_SIZE=$(df -h $TARGET_DIR | grep -o -e '[0-9]\{1,2\}[A-Z\]'| tail -1);
export SIZE=$(du -h $TARGET_DIR | grep -o -e '[0-9]\{1,2\}[A-Z\]'| tail -1);
export PERCENT=$(df $TARGET_DIR | grep -o -e '[0-9]\{1,2\}%')
zenity --info --title="Results" --text="${SIZE} of ${VOL_SIZE} ${PERCENT} is used of ${TARGET_DIR} -"
__________________
AMD Athlon 64 3200
Msi K8N Neo4
2 GB dual-channel PC3200
Saphire ATI x600 Pci-e
160GB WD ide
160GB WD sata
500GB WD sata
---F9-x86_64--
Last edited by wtg_photos; 12th June 2008 at 02:55 PM.
|

12th June 2008, 09:24 PM
|
|
Registered User
|
|
Join Date: Jun 2008
Posts: 7

|
|
|
I've actually think I have it working fairly well. that script sounds fairly handy, but you have to realize that this system is designed to be as dummy proof as possible. It is run via a touch screen, and has 3 buttons. Start app, Stop App, and shutdown the computer. Not sure i want someone looking at a bunch of data about a directory, that they have no idea, is being mapped from the external memory card. LOL
It does seem to be working fairly well though. Thanks for you assistance everybody!
|

12th June 2008, 09:39 PM
|
 |
Registered User
|
|
Join Date: May 2005
Location: NKY
Posts: 106

|
|
for your use you could make it a 4th icon
just make a custom launcher and comment out the dialog box......
and add your /data dir mannually like soooo.
then it only takes 2 taps of a finger to check disk useage(while in flight)
Code:
#!/bin/bash
#zenity --info --title="Disk Usage by Folder" --text="If you would like, I can
#check a directory to see what percentage of space they use?"
# uncomment line below to promt forTARGET_DIR
#export TARGET_DIR=`zenity --file-selection --directory`
# comment out line below to promt forTARGET_DIR
export TARGET_DIR=/data
export VOL_SIZE=$(df -h $TARGET_DIR | grep -o -e '[0-9]\{1,2\}[A-Z\]'| tail -1);
export SIZE=$(du -h $TARGET_DIR | grep -o -e '[0-9]\{1,2\}[A-Z\]'| tail -1);
export PERCENT=$(df $TARGET_DIR | grep -o -e '[0-9]\{1,2\}%');
zenity --info --title="Results" --text="${SIZE} of ${VOL_SIZE} ${PERCENT} is used of ${TARGET_DIR} -"
__________________
AMD Athlon 64 3200
Msi K8N Neo4
2 GB dual-channel PC3200
Saphire ATI x600 Pci-e
160GB WD ide
160GB WD sata
500GB WD sata
---F9-x86_64--
Last edited by wtg_photos; 12th June 2008 at 09:42 PM.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 20:30 (Saturday, 25-05-2013)
|
|
 |
 |
 |
 |
|
|