LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-22-2008, 10:54 AM   #1
bobmac010
LQ Newbie
 
Registered: Jun 2003
Distribution: Slackware
Posts: 29

Rep: Reputation: 15
Want to mount different USB's as /dev/sda1


I consider myself fairly proficient at Slackware Linux, but for the life of me I cannot find out how to mount different USB drives as /dev/sda1.

The problem is that I have a script that makes a backup of Windows boxes, and dumps the files from the windows boxes in a mounted USB HD. The drives are rotated daily. Once the first drive is unmounted, and the second one plugged in, it is recognized as /dev/sdb. How in the heck can I get the second drive to be recognized as /dev/sda without rebooting the server???

My script looks like this:

#! /bin/bash
mount -t smbfs //<servername>/<servershare> /server1 -o username=administrator,password=*****
mount -t smbfs //<servername2>/<servershare> /server2 -o username=administrator,password=*****
mount /dev/sda1 /mnt/usb
cp /server1 /mnt/usb -R
cp /server2 /mnt/usb -R
umount /mnt/usb
umount /server1
umount /server2

I guess I could execute mounts of both /dev/sda1 and /dev/sdb1 on the same directory, let the non-existant device fail, and the valid device mount, but that seems cheezy.

Any help is appreciated...

Bob

Last edited by bobmac010; 01-22-2008 at 10:56 AM.
 
Old 01-22-2008, 12:15 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Why don't you just use udev?
 
Old 01-22-2008, 12:44 PM   #3
bobmac010
LQ Newbie
 
Registered: Jun 2003
Distribution: Slackware
Posts: 29

Original Poster
Rep: Reputation: 15
Duh... Thanks!
I just had a senior moment...

Thanks for your help!

Bob
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Try to mount USB drive: Computer can't find /dev/sda1 gameboypckt Linux - Newbie 5 02-07-2007 09:05 AM
mount /dev/sda1 doesn't work Pyro-dragon Linux - Newbie 6 04-17-2005 10:42 AM
mount: /dev/sda1 is not a valid block device?????help mojarron Slackware 13 03-21-2005 05:33 AM
how to mount /dev/sda1 not only for root? mizuki26 Linux - Newbie 4 11-04-2003 08:15 PM
mount: /dev/sda1 is not a valid block device melody Linux - Hardware 1 09-14-2003 10:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration