Solved

Add harddrive

Posted on 2003-11-05
10
1,183 Views
Last Modified: 2010-04-20
I have an external 20gb USB harddrive that I'd like to use with my Yellow Dog Linux.  The OS can see the drive, but I don't know how to access it.  Do I need to "mount" it?  (This is a term left over from a novice fling with Unix in college.)
0
Comment
Question by:fhieber
10 Comments
 
LVL 12

Expert Comment

by:paullamhkg
ID: 9692371
Yes you have to mount it, normally it act as a SCSI device, so 1st create the partition by using fdisk /dev/sda, you will get as below

Command (m for help): n                < key in n for create a new partition
it will ask you for which partition, which start form 1, afterward from which block to which block, if you wanted to use all the diskspace, just use the default.

afterward
Command (m for help): p               < key in p for display the partition info, and you will get something as below

   Device Boot    Start       End    Blocks   Id  System
/dev/sda1   *         1        33    265041   83  Linux                 < this mean the 1st partition of sda start from 1 to 33 and the type is linux ext2 file system.

if everything ok key in w to finalize the creattion. after created, you need to format your use harddisk, just use mke2fs /dev/sda1 this will format your harddisk to ext3 file system. afterward, create a mount point by mkdir /mnt/usb, now you can mount your usb harddisk by mount /dev/sda1 /mnt/usb, that all.
0
 
LVL 12

Expert Comment

by:paullamhkg
ID: 9692383
But if your usb harddisk is formatted by M$ windoz, ensure it's not NTFS, the method more easier.

1. format it as FAT32
2. mount the usb harddisk by mount -t vfat /dev/sda1 /mnt/usb

That all.

The above 2 method you need to login as root.


if you need to have the usb harddisk mount everytime you reboot/restart your linux, you need to add entry into the /etc/fstab as below.

For linux files system (ext3)
/dev/sda1                /mnt/usb                     ext3    noauto,defaults        1 2

For FAT32
/dev/sda1               /mnt/usb                      vfat     noauto,defaults        1 2

so every you reboot your /dev/sda1 will mount into /mnt/usb, but since usb harddisk is a removable device, I will recomment you to use the noauto, so that everytime when you plug-in you usb harddisk you need to mount it by hand, just mount /dev/sda1 /mnt/usb for linux file system, mount -t vfat /dev/sda1 /mnt/usb for FAT32 file system.

unless you plugin your usb harddisk and keep it without remove it, you can use auto, which will ask your linux distro to mount the device for you automatically so that you no need to mount it by hand.


0
 
LVL 12

Expert Comment

by:paullamhkg
ID: 9692400
oh forgot to mention, ext3 file system is a linux file system, M$ windoz can't read it unless you install the Explore2fs have a check here http://uranus.it.swin.edu.au/~jn/linux/explore2fs.htm.

for NTFS, if you format it as NTFS, have a look here http://linux-ntfs.sourceforge.net/info/ntfs.html#4.9

remember all the above setting you need to login as root for making all the partition or mount point, ordinary user can mount the /mnt/usb after the root setting everything.

Hope this can help.
0
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
LVL 1

Author Comment

by:fhieber
ID: 9694610
I used this drive with Mac OS 9.2

The computer is an old iMac.
0
 
LVL 12

Accepted Solution

by:
paullamhkg earned 125 total points
ID: 9698377
As I remember you are using Yellow Dog linux, which I gave you some hints before, so try to get the macutils here http://www.usinglinux.org/archivers/macutils.html which can read lots of Mac format files from linux :) for mounting process is the same as I memtion before.
0
 
LVL 2

Expert Comment

by:sam_sunder
ID: 9762272
hello fiheber

Here are the quick steps to add an extra hard drive

1. Fdisk (format disk)  - fdisk \dev\<drive>
2. Make File System to use - mkfs -t ext3(which ever filesystem want) /dev/<drive>
     This bascially creates a file system.
3. The main thing you have to do is mount the drive.
     for example - mount -t ext3  /dev/<drive>   /<dir>
     You can also mount at boot time by making an entry in /etc/fstab.
Please check www.yolinux.com if you have more doubts.

regards

sam




0
 
LVL 1

Author Comment

by:fhieber
ID: 9764557
I didn't want to have to format the drive.  I was hoping that I could keep the files that are on it.  It does not look like that is going to work.  I tried to connect the drive to my OS X machine and it said that the disk did not contain a file system that the computer could recognize.
0
 
LVL 12

Expert Comment

by:paullamhkg
ID: 9768588
Do you mean your usb harddisk can't recognize by your OS X? have you try to do any thing on your usb Harddisk? is there any OS 9.2 around which you can read your usb harddisk to ensure the data still there, so that you can at lease make a backup.

OS X is unix like Operating System, so try to get the macutils I recomment before and install into your OS x and use this utility to read your usb harddisk, to see this working or not. still got any trouble post here.

BTW fdisk = fix disk :)
0
 
LVL 44

Expert Comment

by:Karl Heinz Kremer
ID: 10301756
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by paullamhkg
Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

khkremer
EE Cleanup Volunteer
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question