PDA

View Full Version : terminal command for switching partition




bearbo
Aug 31, 2006, 10:01 AM
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
Aug 31, 2006, 10:18 AM
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
Aug 31, 2006, 10:28 AM
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
Aug 31, 2006, 10:35 AM
All partitions and disk drives are mounted under Volumes. To get to these you use:
cd /Volumes/<name>

Edit: 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
Aug 31, 2006, 10:42 AM
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:


/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
Aug 31, 2006, 01:37 PM
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
Aug 31, 2006, 03:48 PM
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
Sep 1, 2006, 05:14 AM
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:



Which gives you:



No need for extra spaces

:D

4np
Sep 7, 2006, 06:38 AM
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

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:


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.

pdpfilms
Sep 10, 2006, 03:42 PM
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.