Mac terminal command for switching partition

bearbo

macrumors 68000
Original poster
Jul 20, 2006
1,858
0
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?

thanks
 

robbieduncan

Moderator emeritus
Jul 24, 2002
24,638
61
Harrogate
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
 

bearbo

macrumors 68000
Original poster
Jul 20, 2006
1,858
0
robbieduncan said:
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
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
 

plinden

macrumors 68040
Apr 8, 2004
3,968
3
All partitions and disk drives are mounted under Volumes. To get to these you use:
Code:
cd /Volumes/<name>
Edit:
bearbo said:
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
Yes
 

mrichmon

macrumors 6502a
Jun 17, 2003
873
2
bearbo said:
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?
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:

Code:
/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.
 

savar

macrumors 68000
Jun 6, 2003
1,952
0
District of Columbia
bearbo said:
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
by the way, its not <code></code>, its [ code][/code] without the space in front of the first "code".
 

bearbo

macrumors 68000
Original poster
Jul 20, 2006
1,858
0
savar said:
by the way, its not <code></code>, its [ code][/code] without the space in front of the first "code".
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
 

robbieduncan

Moderator emeritus
Jul 24, 2002
24,638
61
Harrogate
savar said:
by the way, its not <code></code>, its [ code][/code] without the space in front of the first "code".
If you want to put vB code in your post you can use the noparse tags like:

[plain][code][/code][/plain]

Which gives you:

[code][/code]

No need for extra spaces

:D
 

4np

macrumors 6502a
Feb 23, 2005
963
0
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

Code:
mount
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:

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

Code:
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.
 

pdpfilms

macrumors 68020
Jun 29, 2004
2,383
0
Vermontana
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.

Thanks.