3.4 Exploring External Volumes


Earlier we mentioned that additional hard disks on your system and any network-based disks are all mounted onto the filesystem in the /Volumes directory. Let's take a closer look to see how it works:

 $  ls /Volumes  110GB           Extra 30        Panther         X $  ls -l /Volumes  total 8 drwxrwxrwx  29 taylor  staff     986 22 Sep 16:37 110GB drwxrwxrwx  11 taylor  unknown   374  4 Sep 23:28 Extra 30 lrwxr-xr-x   1 root    admin       1 23 Sep 12:30 Panther -> / drwxrwxr-t  61 root    admin    2074 22 Sep 16:51 X 

There are four disks available, one of which is actually the root (or boot) disk: Panther. Notice that the entry for Panther is different than the others, with the first character shown an l rather than a d . This means it's a link (see Section 4.5.6 in Chapter 4), which is confirmed by the fact that it's shown as Panther in the regular ls output, while the value of the alias is shown in the long listing (you can see that Panther actually points to /).

If you insert a CD or DVD into the system, it will also show up as a /Volumes entry:

 $  ls -l /Volumes  total 12 drwxrwxrwx  29 taylor   staff     986 22 Sep 16:37 110GB dr-xr-xr-x   4 unknown  nogroup   136 17 Aug  2001 CITIZEN_KANE drwxrwxrwx  11 taylor   unknown   374  4 Sep 23:28 Extra 30 lrwxr-xr-x   1 root     admin       1 23 Sep 12:30 Panther -> / drwxrwxr-t  61 root     admin    2074 22 Sep 16:51 X 

Plugging in an iPod and a digital camera proceeds as follows :

 $  ls -l /Volumes  total 44 drwxrwxrwx  29 taylor   staff      986 22 Sep 16:37 110GB dr-xr-xr-x   4 unknown  nogroup    136 17 Aug  2001 CITIZEN_KANE drwxrwxrwx  11 taylor   unknown    374  4 Sep 23:28 Extra 30 drwxrwxrwx   1 taylor   admin    16384 19 Aug 20:54 NIKON D100 lrwxr-xr-x   1 root     admin        1 23 Sep 12:30 Panther -> / drwxrwxr-t  61 root     admin     2074 22 Sep 16:51 X drwxr-xr-x  15 taylor   unknown    510 27 Apr 09:37 Zephyr 

Zephyr is the name of the iPod, and NIKON D100 is the camera.

Now, for a neat trick, let's use Unix commands to look at the files on Zephyr:

 $  ls -F Zephyr  Calendars/              Icon?                   Norton FS Volume Desktop DB              Norton FS Data          Norton FS Volume 2 Desktop DF              Norton FS Index         iPod_Control/ 

These are the files and directories on the iPod. Where's the music? Let's have a peek in iPod_Control :

 $  cd Zephyr/iPod_Control/  $  ls -F  Device/         Music/          iPodPrefs*      iTunes/ $  ls -F iTunes  DeviceInfo*             iTunes Temp 3*          iTunesControl*          iTunesPrefs* iTunes Temp*            iTunes Temp 4*          iTunesDB* iTunes Temp 1*          iTunes Temp 5*          iTunesEQPresets* iTunes Temp 2*          iTunes Temp 6*          iTunesPlaylists* $  ls -F Music  F00/    F02/    F04/    F06/    F08/    F10/    F12/    F14/    F16/    F18/ F01/    F03/    F05/    F07/    F09/    F11/    F13/    F15/    F17/    F19/ $  ls -F Music/F00  A Thousand Years.mp3*                   Moody_s Mood For Love.mp3* African Ripples.mp3*                    My One And Only.mp3* All The Pretty Little Ponie.mp3*        My Thanksgiving.mp3* Apollo.mp3*                             Nucleus.mp3* Arrival.mp3*                            Oh_ Yes_ Take Another Guess.mp3* ... 

So you can see the disk structure the iPod uses and it's completely Unix-friendly: music is stored in the iPod_Control/Music directory, and split into directories called F00 through F19 . [3] Within each directory is a set of audio files (mp3, AIFF, AAC, etc.). You can even copy them using the commands we'll discuss in the next chapter. The iPod maintains a difficult-to-manipulate index of the audio files, so you can't add music to your iPod as easily. However, you can make directories in other areas of your iPod and copy files into them, using your iPod as a portable hard drive.

[3] Surprisingly, this disk structure is identical across iPods, regardless of size. It's a compromise between the slow seeks of a single directory for all data and the needless complexity of each album (or artist) having their own subdirectory.



Learning Unix for Mac OS X Panther
Learning Unix for Mac OS X Panther
ISBN: 0596006179
EAN: 2147483647
Year: 2003
Pages: 88

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net