LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-31-2008, 02:56 PM   #1
louieb39
LQ Newbie
 
Registered: Nov 2005
Distribution: suse
Posts: 16

Rep: Reputation: 0
Finding out new drive in /dev


I pluged in an external drive, I'm trying to mount it.

Its xfs.

My question is, how do I find out what the drive is called in /dev?

Running ubuntu with no gui.
 
Old 12-31-2008, 03:20 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957Reputation: 1957
"fdisk -l" will list all the available drives on your system and their corresponding dev entries.

"cat /proc/partitions" is another simple way to get a list of all available partitions, albeit without much in the way of other defining information.
 
Old 12-31-2008, 04:09 PM   #3
louieb39
LQ Newbie
 
Registered: Nov 2005
Distribution: suse
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by David the H. View Post
"fdisk -l" will list all the available drives on your system and their corresponding dev entries.

"cat /proc/partitions" is another simple way to get a list of all available partitions, albeit without much in the way of other defining information.
Thanks m8!

Anyway to find out how much space is on each drive in /dev?
 
Old 12-31-2008, 05:09 PM   #4
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by louieb39 View Post
Anyway to find out how much space is on each drive in /dev?
Used space or total space?
 
Old 12-31-2008, 05:31 PM   #5
louieb39
LQ Newbie
 
Registered: Nov 2005
Distribution: suse
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by David1357 View Post
Used space or total space?
total space
 
Old 12-31-2008, 05:47 PM   #6
David1357
Senior Member
 
Registered: Aug 2007
Location: South Carolina, U.S.A.
Distribution: Ubuntu, Fedora Core, Red Hat, SUSE, Gentoo, DSL, coLinux, uClinux
Posts: 1,302
Blog Entries: 1

Rep: Reputation: 107Reputation: 107
Quote:
Originally Posted by louieb39 View Post
total space
"fdisk -l" produces output like this
Code:
[machine:~]:fdisk -l

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1305    10482381    7  HPFS/NTFS
/dev/sda2            1306        6527    41945715   83  Linux
/dev/sda3            6528        9138    20972857+  83  Linux
/dev/sda4            9466        9726     2096482+  82  Linux swap / Solaris
Is that the size in bold what you are looking for?
 
Old 12-31-2008, 06:58 PM   #7
louieb39
LQ Newbie
 
Registered: Nov 2005
Distribution: suse
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by David1357 View Post
"fdisk -l" produces output like this
Code:
[machine:~]:fdisk -l

Disk /dev/sda: 80.0 GB, 80000000000 bytes
255 heads, 63 sectors/track, 9726 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1305    10482381    7  HPFS/NTFS
/dev/sda2            1306        6527    41945715   83  Linux
/dev/sda3            6528        9138    20972857+  83  Linux
/dev/sda4            9466        9726     2096482+  82  Linux swap / Solaris
Is that the size in bold what you are looking for?

fdisk -l produces this

Cannot open /dev/sda
Cannot open /dev/sdb
Cannot open /dev/sdc
 
Old 12-31-2008, 07:04 PM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Not sure but you might need to be root for this.

You might be able to use this to become root:

Code:
sudo /sbin/fdisk -l
Or

Code:
su -
Then enter the root password.

Ps. Tip: once the disks are mounted you can get more info using "df". Of, if you can, install pydf, which will give you a nicer output.
 
Old 12-31-2008, 07:38 PM   #9
louieb39
LQ Newbie
 
Registered: Nov 2005
Distribution: suse
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
Not sure but you might need to be root for this.

You might be able to use this to become root:

Code:
sudo /sbin/fdisk -l
Or

Code:
su -
Then enter the root password.

Ps. Tip: once the disks are mounted you can get more info using "df". Of, if you can, install pydf, which will give you a nicer output.

Thanks! sudo was able to produce the info I needed

Aparently the drive is NTFS, could of sworn it was XFS

Sorry for another noob question, but how would I reformat the drive to XFS?
 
Old 12-31-2008, 08:08 PM   #10
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Use mkfs.xfs

You might need to install xfsprogs or whatever it's called on your distro.
 
Old 12-31-2008, 08:53 PM   #11
louieb39
LQ Newbie
 
Registered: Nov 2005
Distribution: suse
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by i92guboj View Post
Use mkfs.xfs

You might need to install xfsprogs or whatever it's called on your distro.
thanks for the help guys

Ok so I reformated the drive with fdisk

made it xfs with mkfs.xfs command

used fdisk to make a partition

Now I'm trying to mount the drive into a folder /B

I did

sudo mount -t xfs /dev/sdc /B

and I'm getting this


mount: wrong fs type, bad option, bad superblock on /dev/sdc,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

any ideas?
 
Old 12-31-2008, 09:05 PM   #12
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Quote:
Originally Posted by louieb39 View Post
thanks for the help guys

Ok so I reformated the drive with fdisk

made it xfs with mkfs.xfs command

used fdisk to make a partition

Now I'm trying to mount the drive into a folder /B
I am not sure I understood you ok.

First thing, is that fdisk doesn't format anything. It just deletes and creates partitions. Few things more.

Actually, formating is the process to create a file system. So, mkfs is what takes care of that part.

The process would be more like this:

Code:
fdisk /dev/sdc
#make partitions and use the 'w' command to write and exit
#you might need to reboot (or maybe not)
mkfs.xfs /dev/sdc1
Assuming that you created a single primary partition inside sdc, it will be called sdc1. Note the slight -but very important- distinction. sdc is the whole block device, sdc1 is the first primary partition. You can create more of course, as long as you have free -non partitioned- space on that drive.

Quote:
sudo mount -t xfs /dev/sdc /B
It's possible to format the drive as a whole, without partitioning it, but you usually don't do that. Hence, if you followed the convention and partitioned the drive the right way, that command should be:

Code:
sudo mount -t xfs /dev/sdc1 /B
If you can't sort it out with the info I provided, paste here exactly the commands that you used. Note that a single character can make a very big difference.
 
Old 12-31-2008, 09:28 PM   #13
louieb39
LQ Newbie
 
Registered: Nov 2005
Distribution: suse
Posts: 16

Original Poster
Rep: Reputation: 0
Thank you! Its mounted and working now.
 
Old 01-13-2009, 04:06 PM   #14
louieb39
LQ Newbie
 
Registered: Nov 2005
Distribution: suse
Posts: 16

Original Poster
Rep: Reputation: 0
Is it possible to make the drive automatically mount on boot?
 
Old 01-13-2009, 04:14 PM   #15
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
Sure. Add it to /etc/fstab.

Check the man page for fstab and mount if you need extra help, and ask here again if you can't figure out how to do it. You can use the already existing lines in that file for inspiration.
 
  


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
finding some dev libraries ozbarry Slackware 5 03-02-2008 08:12 AM
using flash drive changes device /dev/sr0 to /dev/sr1 for mapping to /dev/pktcdvd/0? lugoteehalt Linux - Software 3 10-24-2007 11:27 AM
I cannot access EITHER CD drive! And there's no /dev/hdc or /dev/hdd or /dev/cdrom! Dmalic Linux - Hardware 13 11-18-2005 08:11 PM
Finding my /dev/hardware binarybob0001 Linux - Newbie 12 07-04-2005 05:41 PM
Need help finding libpng-dev IGNGcubeman Linux - Software 3 08-02-2003 12:30 PM


All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration