LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 11-29-2003, 02:58 AM   #1
Nappa
Member
 
Registered: Nov 2003
Posts: 42

Rep: Reputation: 15
mount/umount when changing floppy's or CD's


Don't exactly know how to make an alias that would allow me to view the contents of a floppy or CD each time I put a new one in. Currently I have:

alias a:='mount /dev/fd0 /mnt/floppy | ls /mnt/floppy'

this doesn't work when I put a different floppy in the drive, it still remembers my last floppy. I have to manually umount /dev/fd0 then mount it again to see the new contents.
 
Old 11-29-2003, 04:07 AM   #2
Tarts
Member
 
Registered: Feb 2003
Distribution: Slackware 9.1 (exclusively) ;)
Posts: 344

Rep: Reputation: 30
In Linux there is no specific filesystem drive number(if I said that correct), Linux deals with things in terms of one big filesystem with other filesystems joining (mounting) to the root(/)filesystem tree, therefore there would be no 'e:\' or 'c:\'. To do what you need, it would have to look something like this:

Code:
mount /dev/fd0
Most every device you mount would be in the '/dev' (device) directory, and most every "mount point"(the point to which the filesystem ajoins) would be located in '/mnt'(mount). An alias would look something like this:

Code:
alias mountflop="mount /dev/fd0 && cd /mnt/floppy && ls"
alias umountflop="cd / && umount /dev/fd0"
Also remember that you have to change out of the mount point directory (/mnt) before you unmount the filesystem, otherwise the filesystem is still ajoined even if you try to unmount it with 'umount <dev>'.

Tarts
 
Old 11-29-2003, 04:20 AM   #3
Nappa
Member
 
Registered: Nov 2003
Posts: 42

Original Poster
Rep: Reputation: 15
Thank you for that Tarts, I was wondering why I couldn't umount while in the /mnt/floppy directory. I have customized my alias's to look like this

alias a='mount /dev/fd0 /mnt/floppy ; ls /mnt/floppy
alias a-='umount /dev/fd0'

I just like using 'a' for now because that's what I've been so used to using for ever in DOS. Maybe I'll change it when I'm not such a newbie. However these alias's seem to work for me and allow me to chang out my floppy disk when needed. Thank you for your help. I'm still not sure what the difference using && and ; to seperate commands is.
 
Old 11-29-2003, 07:34 AM   #4
AntEater
Member
 
Registered: Jan 2003
Location: Vermont
Distribution: Slackware
Posts: 39

Rep: Reputation: 19
Quote:
I'm still not sure what the difference using && and ; to seperate commands is.
When using "&&" between the commands the second command will execute only if the first command returns a successful value. Using the semi-colon will cause the commands to execute in order regardless of the return values.
 
  


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
changing cds for wine? umount ->device is busy darkleaf Linux - Software 1 12-05-2004 10:24 AM
root can only mount/umount snocked Linux - Newbie 9 04-22-2004 02:52 PM
mount/umount devit Linux - General 4 02-19-2004 12:37 PM
mount and umount wr3ck3d Linux - Newbie 4 12-14-2002 04:04 PM
mount, umount cdrom Opaque Linux - Newbie 3 06-21-2001 09:30 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 06:24 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