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. |
"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. |
Quote:
Anyway to find out how much space is on each drive in /dev? |
Quote:
|
Quote:
|
Quote:
Code:
[machine:~]:fdisk -l |
Quote:
fdisk -l produces this Cannot open /dev/sda Cannot open /dev/sdb Cannot open /dev/sdc |
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 Code:
su - 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. |
Quote:
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? |
Use mkfs.xfs
You might need to install xfsprogs or whatever it's called on your distro. |
Quote:
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? |
Quote:
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 Quote:
Code:
sudo mount -t xfs /dev/sdc1 /B |
Thank you! Its mounted and working now.
|
Is it possible to make the drive automatically mount on boot?
|
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. |
All times are GMT -5. The time now is 09:35 PM. |