[BSD Unix] Accessing external drives through terminal
Register

We are the best invite forum on the internet! Here you will find free invites, free seedboxes, free bonuses, and much more. Our members know the true meaning of sharing and have created a truly global bittorent community! Our site has the most up to date information on all private trackers and our members will guide you and introduce you to this truly secretive and enlightened club. Ready to get started? Register now!


Results 1 to 7 of 7
  1. #1

    Join Date
    Aug 2008
    Posts
    794

    Default [BSD Unix] Accessing external drives through terminal

    My friend just installed OpenBSD on my recommendation, but when he went to copy his music from his external HDD, he found he didn't have a clue what to do, since OpenBSD doesn't have a /media directory or a auto mounter, and Gnome won't show non root drives up until they are manually mounted. So after I shown him how to do it, I decided to write a brief tutorial on it. This technique will probably work on most other Unix OSs around (Including Mac OSes that are based on BSD) , but it may differ a lot on Linux, since Linux uses a easier system now on most distros.



    When typing in commands I give you the commands in quotation marks.... Don't put the quotation marks into the commands =)

    Plug in your external drive.
    Wait about 6 seconds, for Unix to find and initialize the drive.
    Open up a terminal. I doesn't matter which shell it is using.
    Type 'dmesg' and press enter.
    Look at the bottom of the output 'dmesg' gave you.

    When I plugged my iPod Mini in, this is the information 'dmesg' gave me at the bottom.
    Code:
    inumass0 at uhub0 port 1 configuration 1 interface 0 "Apple iPod mini" rev 2.00/0.01 addr 2
    umass0: using SCSI over Bulk-Only
    scsibus1 at umass0: 2 targets, initiator 0
    sd0 at scsibus1 targ 1 lun 0: <Apple, iPod, 1.62> SCSI0 0/direct removable
    sd0: 3906MB, 497 cyl, 255 head, 63 sec, 512 bytes/sec, 7999488 sec total
    From reading this, I learned that my iPod was 'sd0'. I gathered this information from the last two lines. It should be similar for you.

    Now type 'disklabel XXX'. replace XXX with whatever your drive is called by BSD. For me, it was called 'sd0'. For you it may be different.

    Now, you will see the partitions on the drive. You need to spot the partition you want to mount. For example, if you want to access a 40GB iPod, you should probably look for the partition that is using FAT32 and has around 40GB in size. I will show a example below. You may see some partitions that you weren't aware of, don't worry about this.

    This is the 'disklabel' output for my iPod.
    Code:
    #                size           offset  fstype [fsize bsize  cpg]
      c:          7999488                0  unused      0     0      
      i:            32067               63  unused      0     0      
      j:          7903980            80325   MSDOS                   
      k:            48195            32130  ext2fs
    The partition I payed attention to was 'j:' because it had a large size and it says it is using a MSDOS filesystem (FAT32), which common sense tells me its the partition I want. The reason for the other partitions is due to BSD and hidden partitions on iPods.

    So I now know that my iPod is sd0 and the partition I want is 'j'.

    Now you need to create a directory to access your drive from. So, if you want it in /home/user/ipod you would have to create that directory by typing 'mkdir -p /home/user/ipod' into the terminal and pressing enter. For this example I created a directory in /mnt/iPod by typing 'mkdir -p /mnt/iPod' into the terminal and pressing enter. Now you have your directory you want to access the drive from.

    Now, let's mount the drive.

    My iPod is sd0, and I want to mount partition j. I want to mount it into /mnt/iPod. So, this is what I would type.
    Code:
    mount /dev/sda0j /mnt/iPod
    This is the syntax...
    Code:
    mount /dev/XY Z
    X=The drive name (For me it was sda0)
    Y=The partition letter (For me it was j. This comes straight after the drive name with no space)
    Z=The directory you want to access the drive from.

    So, if I wanted to mount the drive 'hda1' partition 'e', and access it from directory /root/External_HDD I would type this...
    Code:
    mount /dev/hda1e /root/External_HDD
    That's it. This should really only be used on servers and stuff. Sane people would install an auto mounter on a workstation PC, making their lives a lot easier. Hope that helped some of you out. =D
    Last edited by SunSpyda; March 4th, 2009 at 01:22 PM.


  2. To remove ads become VIP. Inquire about advertising here.
  3. #2

    Join Date
    Aug 2008
    Posts
    1,082

    Default

    nice info man !
    You're the best for this things !
    Really mean this

  4. #3

    Join Date
    Mar 2009
    Posts
    76

    Default

    Hey, bro, I find really useful in your article. I just saved all of them to Evernote.
    I'm learning Linux/Unix now, however, like your article mentioned, I'm the kind of newbie. At the first time, I try to install a FreeBSD in my computer, indeed, I succeed installing it and with the FVWM desktop enivronment with some softwares(Lyxn, Firefox), I read some articles and configured to dial to the internet. However, When I found everything should do in CLI, I then had no patience.

    The second time, I installed Ubuntu instead of BSD. I must say, compare to BSD, ubuntu is so easy to use, that there are no doubt it is becoming more and more fashionable.

    Thank you for you articles, they are really helpful. I hope in the future I can see more insightful articles from you.

    Do you mind to PM your email address, I want to consult you about how to use linux/unix. Many thanks!

  5. #4

    Join Date
    Aug 2008
    Posts
    794

    Default

    FreeBSD has the option to install a full fledged DE like Ubuntu (Gnome) if you want. It's just that Ubuntu has it by default, whilst it's optional in the BSDs =) *nix is most powerful through a CLI, but if you want a full DE like on Ubuntu, you could have just installed it on FreeBSD.... Just saying =P

    I use BSD and Linux, but I must say that I do prefer BSD, but I'm still using Debian quite a lot.

    I actually check my PMs more than my email (I sometimes don't check my email from one week to the next), so if you wanted to contact me, it would probably be best done through PMs or visitor messages. If you need any *nix help however, I recommend to post it in the forum, so others can help you out as well =)

  6. #5

    Join Date
    Mar 2009
    Posts
    76

    Default

    SunSpada, thank you.
    I thought that people are all checking mails from dawn until dark like me. LOL
    Yeah, I will consult you throgh PM or post my problem in the forum, I know you guys are well in LINUX/UNIX.

    I am a fledging, haha, I used Microsoft's software for almost ten or more years. From DOS to Vista. However, when I know more about what is Linux/Unix/GNU, I decided to devote to it.

    But it is a pity, Linux/Unix still need some improvement at 'User Friendly'. Indeed Ubuntu are well, but the Windows users need to get a full list of transfering software. They must know they can do everything in Linux/Unix too.

    In fact, I used Linux several years ago, however, I droped it. Because, it seems not so easy to use, even for the people like me having well experience in XP, but just a fledging in Linux/Unix.

    Today, I'm back again and decided to drop XP, or future Microsoft's softwares.

  7. #6

    Join Date
    Mar 2009
    Posts
    41

    Default

    it worked for me like a magic

  8. #7

    Join Date
    Aug 2008
    Posts
    794

    Default

    Quote Originally Posted by cinker View Post
    But it is a pity, Linux/Unix still need some improvement at 'User Friendly'.
    Yeah, the problem is that there are too many competing desktop environments (KDE,Gnome and Xfce) and shells (Bash, Korn and C shell), so *nixes UI is too inconsistent.

    I am learning a scripting language called 'Ruby' so I can control multiple OSes with a single language, so it doesn't matter what *nix/Windows/OS X computer I have to operate. I found learning all the shell languages of all my OSes is too much work.

    Fortunately, Linux seems to be getting consistent; Gnome is becoming the popular DE, Bash is the standard shell these days, and most Linuxes are using Apt or RPM, both of which are pretty similar.

    BSD is another story.... Korn is the standard shell, FVWM is the default XWM on many of them, and they all have a different package manager to Linux (Although a few rare Linuxes are actually using BSD's package system).

Similar Threads

  1. Replies: 10
    Last Post: January 17th, 2010, 12:45 AM
  2. Replies: 3
    Last Post: December 10th, 2009, 06:12 PM
  3. Replies: 0
    Last Post: August 8th, 2009, 04:01 AM
  4. Uploading from external drive
    By PhuKiNLucKy in forum BitTorrent Discussion
    Replies: 5
    Last Post: June 27th, 2009, 02:01 AM
  5. Replies: 0
    Last Post: May 29th, 2008, 07:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •