Page 1 of 2
newb linux question...listing my drives (mounts)
Posted: Wed Sep 27, 2006 11:26 am
by Burrito
how do I list all of the drives on my server?
Let's say I have a cdrom drive, and two hard drives. How can I list out all of those drives?
Posted: Wed Sep 27, 2006 11:42 am
by Jenk
All devices will be in the /dev (sometimes /devices - depends on distro) directory. To access them you'll need to mount them as root, e.g.:
Code: Select all
sudo mount /dev/hda1 /mnt/drive1
sudo mount /dev/cdrom /mnt/cdrom
You can probably get a GUI to run in KDE/Gnome or any other DE.. I'll have a butchers to see if I can find anything.
Posted: Wed Sep 27, 2006 11:59 am
by Weirdan
mount command without options would show you the list of mounted devices
Posted: Wed Sep 27, 2006 12:04 pm
by Burrito
Weirdan wrote:mount command without options would show you the list of mounted devices
Code: Select all
[root@devserver dev]# mount
/dev/sda5 on / type ext3 (rw)
/dev/proc on /proc type proc (rw)
/dev/sys on /sys type sysfs (rw)
/dev/devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/sda2 on /boot type ext2 (rw)
/dev/shm on /dev/shm type tmpfs (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
automount(pid1873) on /net type autofs (rw,fd=4,pgrp=1873,minproto=2,maxproto=4)
automount(pid1840) on /misc type autofs (rw,fd=4,pgrp=1840,minproto=2,maxproto=4)
[root@devserver dev]#
unfortunately this means very little to me....care to translate?
Posted: Wed Sep 27, 2006 12:09 pm
by Weirdan
you mounted two partitions from first sata disk. one partition is mounted on root (/), another mounted on /boot.
mnemonics:
sd - SATA disk
sda - first SATA disk
sdb - second SATA disk
sda1 - first partition on first SATA disk
sdb5 - fifth partition on second SATA disk
...
You can use df to get somewhat more meaningful info about mounts (it's primary purpose is to show disk usage info though).
Posted: Wed Sep 27, 2006 12:25 pm
by Burrito
ahh yes 'df' was much easier to understand. Although it didn't show me my cdrom drive.
I know this is going to sound really lame and I'm almost reluctant to ask it, but isn't there way I can just see what is on 'My Computer' without using some kind of GUI?
basically I want the same thing as when I dbl click 'My Computer' in winders, but just listed out in puTTy for me...
Posted: Wed Sep 27, 2006 12:37 pm
by Weirdan
I know this is going to sound really lame and I'm almost reluctant to ask it, but isn't there way I can just see what is on 'My Computer' without using some kind of GUI?
No, no such thing that I'm aware of. Either you're admin and you know what hardware is installed on your system (or can easily get that info from
dmesg output), or you're just a user, in which case you don't even need to know what hardware runs your system.
Posted: Wed Sep 27, 2006 12:38 pm
by Weirdan
Although it didn't show me my cdrom drive.
Both
mount and
df show only
mounted devices.
Posted: Wed Sep 27, 2006 12:39 pm
by Jenk
df/mount is about the best you'll get in ASCII format. I've not found anything, bar Konqueror for GUI's which requires a DE.
Linux doesn't label drives in the way Windows does. As far as the OS is concerned, it's just another directory.
Posted: Wed Sep 27, 2006 12:46 pm
by Burrito
Jenk wrote:Linux doesn't label drives in the way Windows does. As far as the OS is concerned, it's just another directory.
right, I understand that, but it'd be nice to see those 'directories' separated into different physical devices.
Posted: Wed Sep 27, 2006 1:58 pm
by Jenk
Logical naming
Example, apart from /boot (hda1), / (hda3) and my swap space (hda2)
I've got:
/mnt/cdrom (cdrom)
/mnt/ntfs1
/mnt/ntfs2
/mnt/ntfs3
etc.
Before I blatted windows I had them as /mnt/D /mnt/E etc.
EDIT: Forgot to add that I can now ls -l in my /mnt directory to see all mounted drives (that are not /boot / or swap.) and in KDE It looks just like "My Computer"
Posted: Wed Sep 27, 2006 2:06 pm
by Burrito
uggh...
my problem is I was just put in charge of this server (the last guy just up and left), and I have no idea how he set it up, so sorting through this, as you can imagine, is a nightmare....especially when you consider that my *nix knowledge is pretty poor to begin with.
Posted: Wed Sep 27, 2006 2:20 pm
by Jenk
indeed, took me a good while to get used to it all, and to 'accept' it above all else.
Also to ensure they are mounted on boot you'll need to edit your fstab file (normally in /etc/fstab)
This is always fun.. Here is what mine looks like:
Code: Select all
#DISK1
/dev/hda1 /boot ext2 noauto,noatime 1 2
/dev/hda3 / ext3 noatime 0 1
/dev/hda2 none swap sw 0 0
# DISK2
/dev/hdb1 /mnt/ntfs1 ntfs ro,nouser,auto 0 0
/dev/hdb2 /mnt/ntfs2 ntfs ro,nouser,auto 0 0
/dev/hdb3 /mnt/ntfs3 ntfs ro,nouser,auto 0 0
# MISC.
/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0
#/dev/fd0 /mnt/floppy auto noauto 0 0
# NOTE: The next line is critical for boot!
proc /proc proc defaults 0 0
shm /dev/shm tmpfs nodev,nosuid,noexec 0
This page is great for getting to grips with fstab:
http://www.tuxfiles.org/linuxhelp/fstab.html (as is the entire site for getting to grips with *nix

)
Posted: Wed Sep 27, 2006 2:58 pm
by nickvd
You should also be able to run the disk partitioning util and use it to list all partitions, mounted or not. BE CAREFUL as you can nuke your server if you hit the wrong key... but afaik it's the only way to see ALL partitions across ALL disks, mounted or not...
Posted: Wed Sep 27, 2006 3:54 pm
by Jenk
will safely display all available partitions/drives, but only HDD's (SCSI/SATA/ATA) not CD/DVD or Floppy, or USB.
