terminal command for switching partition

Discussion in 'Mac Programming' started by bearbo, Aug 31, 2006.

  1. bearbo macrumors 68000


    Jul 20, 2006
    okay, first of all, forgive me for my ignorance

    alright, so when i start terminal, i'm in /User/MyUserName/
    and after i go <code> cd ../.. </code>, i get to the root

    now, i have a few other partitions (ext. hdd, windows, etc), how do i get to the root of other partitions?

  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    In Unix all drives are mounted into the same filesystem so there is nothing like A:, C:, D: etc in Windows. The root of the filesystem is / so a cd / changes you to the root. A mounted partition or drive will simply look like a directory you can cd into it.

    You can found out where drives or partitions are mounted to with the mount command. OSX tends to mount everything apart from startup disk/partition in /Volumes
  3. bearbo thread starter macrumors 68000


    Jul 20, 2006
    i tried the <code>mount</code>, it tells me i have stuff such as /disk1s3 or something, but when i do <code>mount /disk1s3 </code> or <code> mount /Volumes/disk1s3 </code>, it doesnt work either

    can you suggest a format that i should use?

    edit: wait, did you mean everything is in /Volumes, as in i can <code> cd /Volumes </code> and get to things? i'll try that
  4. plinden macrumors 68040


    Apr 8, 2004
    All partitions and disk drives are mounted under Volumes. To get to these you use:
    cd /Volumes/<name>
  5. mrichmon macrumors 6502a

    Jun 17, 2003
    If the partitions are showing up on your desktop then they are already mounted and you do not need to bother about using the mount command to mount them. If you just enter the command mount at the terminal then you will be shown a list of currently mounted filesystems. The only lines of the output from mount that you need to look at are the lines starting with /dev/disk such as:

    /dev/disk0s3 on /Volumes/data (local, journaled)
    /dev/disk1s3 on /Volumes/musicdata (local, journaled)
    The two lines above show a partition named "data" mounted at /Volumes/data and another partition (on a seperate disk) named "musicdata" mounted at /Volumnes/musicdata.

    To access the contents of the "musicdata" partition via the terminal you use the command cd /Volumes/musicdata.
  6. savar macrumors 68000


    Jun 6, 2003
    District of Columbia
    by the way, its not <code></code>, its [ code][/code] without the space in front of the first "code".
  7. bearbo thread starter macrumors 68000


    Jul 20, 2006
    haha, why thank you... i wasn't quite trying to get that little-window effect, but rather just something i do across many forums... but appreciate it either way
  8. robbieduncan Moderator emeritus


    Jul 24, 2002
    If you want to put vB code in your post you can use the noparse tags like:


    Which gives you:


    No need for extra spaces

  9. 4np macrumors 6502a


    Feb 23, 2005
    The Netherlands
    In a UNIX environment you mount filesystems (eg. partitions on a particular disk or external filesystem) in order to gain access to them, and you unmount them when you're done with them (especially for detachable devices like a firewire harddisk, usb drive, etc). In fact, upon shutdown a UNIX system unmounts all mounted filesystems...

    If you type

    You see a list of mounted filesystems (either local -/dev/hdXY- or remote like smbfs) and their mountpoints. In a normal unix environment mountpoints are generally stored in /mnt; in Darwin this works a bit differently. Whenever you cd into a mountpoint you are in the root of that particular filesystem. A mountpoint is nothing more than an empty directory which is referenced to some filesystem.

    Also, you wrote you changed to the root directory by typing:

    cd ../..
    You could have done that with less typing like this:

    cd /
    In unix ., .. and ~ have special meanings:

    . = the current directory (for example, execute file bla.pl in the current directory: ./bla.pl)
    .. = the parent directory of the one you're in right now
    ~ = your user directory (cd ~)
    / = the root directory and/or path seperator (cd /)

    For the rest I would recommend some Unix for dummies guide, or better, Darwin for dummies as Darwin is a bit different compared to regular unixes / linux environments.
  10. pdpfilms macrumors 68020


    Jun 29, 2004
    Can someone post a simple guide to mounting an external drive through single user mode? All i need to do is move a file from a volume to an external drive, and I can't make the computer see that external drive. After reading through the above, i feel there is a lot being skipped over, that noob Uinx users such as myself aren't so quick to fill in.


Share This Page