Solved

Linux Question (Beginner)

Posted on 2011-02-16
5
418 Views
Last Modified: 2013-11-17
I need to find out what disks I have, actually I need to understand the disk environment better.

I perform the following:

[root@hx5 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       23G   13G  9.4G  57% /
/dev/sda1              99M   13M   81M  14% /boot
tmpfs                  32G     0   32G   0% /dev/shm
//10.14.10.10/CTTShare
                      3.6T  698G  2.7T  21% /mnt/archiver

Open in new window


Obviously I must have a sda and probably a sda2 in addtion to the sda1 listed.

How can I see a list of all drives in Linux

How can I see a list of all devices
0
Comment
Question by:Los Angeles1
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:DangerousJeff
ID: 34910614
fdisk -l

Open in new window

will show you all found drives/partitions (thats a lowercase L), might need to do as root.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 34910815
The disk is /dev/sda (SCSI disk "a").

/dev/sda1 is the first partition on /dev/sda

To see details about LVM (Logical Volume Manager) try:

pvdisplay - display attributes of a physical volume
vgdisplay - display volume groups and their attributes
lvdisplay - display attributes of a logical volume

It's indeed similar to AIX' lspv, lsvg, lslv ...

wmp

0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 34914539
>> How can I see a list of all devices  <<

Try "lspci", "lsusb", "lsscsi" and "lsdev":

lspci - list all PCI devices
lsusb - list USB devices
lsscsi - list SCSI devices (or hosts) and their attributes
lsdev - display information about installed hardware

As for the LVM stuff - it's really similar to LVM in e.g. AIX.

"fdisk" divides hard  disks into one or more logical disks called partitions. We don't have (need) this in AIX.
"fdisk -l" shows the partition tables for the specified devices or all devices in /etc/partition.

Disks are named following this scheme:
/dev/hd[a-h] for IDE disks, /dev/sd[a-p] for SCSI disks, /dev/ed[a-d] for ESDI disks, /dev/xd[ab] for XT disks
Partition names consist of device names followed by a number, where
IDE disks can have up to 63 partitions, SCSI disks up to 15

"pvcreate" initializes a disk or partition for use by LVM. Under AIX this happens automatically by adding a disk to a VG.
"pvdisplay" shows the attributes of the created physical volumes (AIX: "lspv").

"vgcreate" creates  a volume group using the PVs from "pvcreate". In AIX we have "mkvg" for this purpose.
"vgdisplay" lists the attributes of these volume groups, like "lsvg" in AIX.
There is also "vgextend" (like "extendvg" in AIX) and several more VG commands.

Finally "lvcreate" is used to define a logical volume in a volume group. As you might have guessed, this is like "mklv" in AIX.
"lvdisplay" shows LV attributes, like "lslv" in AIX does.

"man lvm" has a list of LVM commands at the bottom.

Use the LVs to build filesystems on them by means of e.g. "mkfs". Use the name of the special file corresponding to the particular LV as the device parameter.

"man mkfs" has more info, particularly it has a list of the commands for each available filesystem type, since mkfs is only a wrapper.
See "man fs" for a list of Linux filesystem types.

Have fun!

wmp
0
 
LVL 6

Expert Comment

by:mohansahu
ID: 34923625
Hi,

1.Under Linux, all data are stored as files. Most users are familiar with the two primary types of
files: text and binary. But the /proc/ directory contains another type of file called a virtual file. It
is for this reason that /proc/ is often referred to as a virtual file system.

2.Virtual files such as
/proc/interrupts,
 /proc/meminfo,
 /proc/mounts, and /proc/partitions

 provide an up-to-the-moment of the system's hardware. Others, like
the /proc/filesystems file and the /proc/sys/ directory provide system configuration
information and interfaces.
Cheers,
MS
0
 
LVL 6

Expert Comment

by:mohansahu
ID: 34923648
Hi,

Use dmidecode command also.

MS
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Anti-virus for Linux Server 15 126
Removing DES and 3DES ciphers in linux RedHat 6.8 38 95
Codiing Non-Existent Links 4 65
Linux  Script File Attributes 5 52
Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now