LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 01-11-2004, 02:23 PM   #1
Ryknow215
Member
 
Registered: Dec 2003
Location: Connecticut
Distribution: Fedora Core 2
Posts: 55

Rep: Reputation: 15
Putting a filesystem on an external USB Hard Drive


I've got a dual-boot system with my main HDD running XP/Linux, my 2nd HDD w/ a NTFS filesystem for more XP storage and a third HDD that has a partition on it w/o a filesystem connected via USB. How can I add a filesystem to my third drive so that i can use it to store extra Linux stuff? Thanks in advance for any help .
 
Old 01-11-2004, 06:16 PM   #2
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 56
Did you want to share the files on your third harddrive between Linux and Windows? If so, then you'll need to format it as VFAT (FAT32 in Windowspeak)... but beware, I believe that there is a limit of 10Gb-ish for vfat partitions. If not, then you can format it as EXT3 (or another Linux filesystem of your choice).
Code:
FAT32
  • fdisk /dev/sda
  • Create as many partitions as you like. Be aware that the default filesystem type for fdisk under Linux is 83 which is a Linux filesystem. You will need to change these to c which is FAT32 before saving changes. Also be aware that if you want more than 4, you will need to create an extended partition and then put additional logical partitions within it.
  • Save changes and quit fdisk
  • mkfs.vfat /dev/sdaX for each partition that you created. The X should be replaced with a number. If you're unsure of the numbers - what they are, or how many - then type fdisk -l /dev/sda
  • Your partitions should now be formatted. You will need to mount them before you can access them.
EXT3
  • fdisk /dev/sda
  • Create as many partitions as you like (type c), but you can use the whole disk with EXT3.
  • Save changes and quit fdisk.
  • mkfs.ext3 /dev/sdaX, again where X is a number.
  • Again, you will need to mount before you can use the partition(s).
Hope this helps.
 
Old 01-11-2004, 07:48 PM   #3
Ryknow215
Member
 
Registered: Dec 2003
Location: Connecticut
Distribution: Fedora Core 2
Posts: 55

Original Poster
Rep: Reputation: 15
My next questions may sound somewhat ridiculous, you'll see how big of a linux newbie i really am . How can i see what devices are attached to my system, i.e. my external hard drive?

In the terminal, i typed: [ryan@localhost ryan]$ fdisk /dev/sda
bash: fdisk: command not found
 
Old 01-11-2004, 07:58 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,985

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
You need to be logged in as root to use the fdisk command. In a terminal type:
su -
(Then use roots password)

BTW a users path enironment does not include /sbin or /bin which is where most system utilities are located. You can change a users path or type in the full path at the prompt.
 
Old 01-17-2004, 12:36 PM   #5
Ryknow215
Member
 
Registered: Dec 2003
Location: Connecticut
Distribution: Fedora Core 2
Posts: 55

Original Poster
Rep: Reputation: 15
Question

So it looks like i can't do anything w/ my external usb 2.0 hard drive. When i look at my hardware profile, my 3rd drive isn't listed so i can't put a filesystem on it. Am i better off putting my third hd into my system and having my current 2nd xp storage drive go external? i'm totally lost and have no idea what to do, any help is appreciated. .
 
Old 01-17-2004, 01:06 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,985

Rep: Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753Reputation: 753
With the drive plugged in look at the output of dmesg. Look for any errors related to the USB drive.

Also look at the output of lsmod. Are the usb modules being loaded?
/sbin/lsmod

usbcore
usb-uhci or usb-ohci (for USB 1.0)
usb-storage
usb-ehci (For USB 2.0 )
 
Old 01-17-2004, 01:24 PM   #7
Ryknow215
Member
 
Registered: Dec 2003
Location: Connecticut
Distribution: Fedora Core 2
Posts: 55

Original Poster
Rep: Reputation: 15
/sbin/lsmod
usb-uhci 26348 0 (unused)
usbcore 78784 1 [hid usb-uhci]

it seems that usb-ehci isn't being loaded. how can i correct this problem?
 
Old 01-17-2004, 06:33 PM   #8
Thymox
Senior Member
 
Registered: Apr 2001
Location: Cornwall, England.
Distribution: Debian + Ubuntu
Posts: 4,345

Rep: Reputation: 56
modprobe ehci-hcd should load the ehci module. It is not usb-ehci. If in doubt, look in the directory /lib/modules/your-kernel-number/kernel/drivers/usb and see what is in there.

Ok, here's what I did to use an 80Gb ATA-133 harddrive connected to a USB 2 --> IDE adapter plugged into my USB 2.0 hub:

Boot into Mandrake 9.2
Check that ehci-hcd has been loaded. As root type lsmod. If not, then modprobe it.
Fire up the programme usbview so I can check which usb module picks up the about-to-be-plugged-in drive.
Plug in the adapter (harddrive and power already connected up).
Bingo... USB2 device has picked up a removable storage device.
Check what device it is. As root type fdisk -l.
Since I have no other SCSI devices, I am looking for the only scsi device listed.
Code:
# fdisk -l

Disk /dev/scsi/host0/bus0/target0/lun0/disc: 82.3 GB, 82348277760 bytes
255 heads, 63 sectors/track, 10011 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                                Device Boot    Start       End    Blocks   Id  System
/dev/scsi/host0/bus0/target0/lun0/part1   *         1         10011     80413324  83  Linux
Great! So I know it is /dev/sda.
If there are any partitions on it already, then they'll be listed as above. If not, then you can either use fdisk, cfdisk or diskdruid to create/edit the partitions on the drive.
Check to see if there is an entry in my /etc/fstab file. If there is, read off what the mount-point is. If not, then create a mount-point for it.
If there is a mount-point already in the fstab then mount it.
If you have just created the mount-point, then edit your fstab to reflect this and then mount it.
Viola.

Hope this helps.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
External USB hard drive jhmorris47 Linux - Hardware 6 05-02-2006 04:14 PM
Installing grub to external USB hard drive for later use as internal hard drive dhave Linux From Scratch 2 12-10-2005 08:48 AM
Mounting root filesystem from an external USB hard drive? ChrisHart Linux - Laptop and Netbook 6 04-02-2005 10:49 PM
XS Drive II external USB hard drive/card reader max74 Linux - Hardware 7 10-21-2003 10:41 PM
External USB hard drive bob10a Linux - General 3 08-09-2003 03:48 PM


All times are GMT -5. The time now is 08:02 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration