Bash & Mounting CD-ROM

Adam bsdx@looksharp.net
Tue, 22 Aug 2000 11:31:27 -0400 (EDT)


First of all, if any of these dont exist in /dev, you can cd to /dev and
./MAKEDEV blah0 to create it.  Some things like disk devices may make
devices foo0 through foo5 if you do MAKEDEV foo6, so if trying to MAKEDEV
something specific doesnt work,  try one number higher.  Also if it still
doesnt work, chop off any characters after the number in the device name. 

/dev/acd0c is the usual device for the first atapi cdrom in most recent
versions of FreeBSD, stands for AtapiCd0(partition)c where the c means The
whole disk.  I think a also works for cdroms and is preferred but in my
experience c usually works for me and until someone stands up and smacks
me with a cluebat on that one ill keep using it. 
/dev/acd1c for the second atapi cd, etc.  

In older versions of FreeBSD around 3.x and earlier it was wcd0c for atapi
cdroms. 

In FreeBSD 4+, atapi disks are ad0, ad1, etc, and scsi are da0
(Atapi Disk and Direct Access)

In FreeBSD < 3, it had an older scsi system and scsi disks were called sd0
for Scsi Disk.  It also had od0 for optical disks and I believe support
for OD's got folded into da0 in FreeBSD 3+. 

For BSD partitioning, the dev name format is like this:

da0s1a  (driver da, physical disk 0, slice 1, partition a)
slices are what DOS called partitions, and you can think of BSD partitions
as DOS logical partitions inside a extended.  
a = root partition, you usually only have one total in a single installed
system unless you plug in disks from other systems
b = swap
c = whole disk
d = unused in FreeBSD, forgot what it stands for
e,f,g,etc = whatever other partitions you make. 

For accessing MSDOS partitions, you want devices like this:
ad0s1 = first primary dos partition (if it exists)
ad0s2 = second primary dos partition (if it exists, rare because MS Oses
not including nt4 and win2k do not like multiple primary dos partitions)
ad0s3 = third primary dos partition (if it exists, rare)
ad0s4 = fourth primary dos partition (if it exists, rare)
ad0s5 = first *logical* dos partition inside the Extended dos partition
ad0s6 = second logical dos partition inside the Extended dos partition

The ad0s1-4 will exist by default I believe, but ad0s5 and higher will
have to be specifically MAKEDEV'ed.  mkdir a dir somewhere to mount it on,
then mount -t msdos /dev/ad0s1 /mountpoint  to mount a fat16, vfat16, or
fat32 primary partition on /mountpoint. 

As for the shell:  Since the default partitioning usually puts /usr on a
different partition than root (optional), people usually stick to the
statically compiled shells in /bin for the root user namely /bin/sh and
/bin/csh (and /bin/tcsh in 4+).  The toor user you see in vipw is usually
used to activate a root user with an alternative shell just so you have a
perfectly working root user incase /usr falls off the face of the earth in
multiuser.  If the system cannot boot however, or you boot into singleuser
mode on purpose,  init will ask you what shell you'd like to run
defaulting to /bin/sh, so a dynamically compiled shell not on the root
partition is only a danger if you do not have frequeny physical console
access.  Given this warning, you can pkg_add -r bash2 (to fetch it from
the net automagically) or pkg_add it from a package cd, or add it from
sysinstall, or cd /usr/ports/shells/bash2 && make install clean; this will
get bash2 installed as /usr/local/bin/bash.  You may then proceed to run
chsh or vipw, go in and change your shell to /usr/local/bin/bash and save
it.  If you donot like vi, set the EDITOR variable in your environment
first.  Dont bother mv'ing bash from /usr/local/bin unless you really want
to, it wont improve functionality any and the packages system will just
lose track of whats installed if you move things.  

Feel free to ask more, I have some free time :)


On Tue, 22 Aug 2000, Alex Morris wrote:

>Can anyone confirm this?  It would suck horribly if you can't mount a 
>partition via "mount".
>
>- Alex
>
>----Original Message Follows----
>I'm still learning, sloooowly, but one way to mount the partitions is by
>logging on as root and doing a /stand/sysinstall which will allow you to
>mount the partitions using the fdisk utility without hurting anyting
>else.  Don't know about the other questions.
>
>John
>
>At 01:30 PM 8/22/00 +0000, Alex Morris wrote:
>>I have recently installed FreeBSD.  However, I have two huge problems
>>(plus a whole slew of little ones).  First off, how the heck do I mount my
>>CD-ROM drive?  My best guess (which failed miserably) was to do: mount
>>/dev/cd0a /cdrom
>>
>>Secondly, how do I switch root from csh to bash?  I have my
>>non-priveledged user running bash but cannot figure out how to switch root
>>over.
>>
>>Oh, and as long as I'm asking about mounting, where the heck did /dev/hd*
>>go?  I need to mount some FAT32 and NTFS5 partitions but don't have a clue
>>where to find them in my /dev list.
>>
>>Lastly, where might I find a good resource for learing FreeBSD
>>(freebsd.org doesn't appear to exist...)?
>>
>>Thanks,
>>Alex
>>________________________________________________________________________
>>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>>
>>_______________________________________________
>>linux-user mailing list
>>linux-user@egr.msu.edu
>>http://www.egr.msu.edu/mailman/listinfo/linux-user
>
>
>
>________________________________________________________________________
>Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com
>
>_______________________________________________
>linux-user mailing list
>linux-user@egr.msu.edu
>http://www.egr.msu.edu/mailman/listinfo/linux-user
>