This discussion is archived
1 2 Previous Next 15 Replies Latest reply: Jul 9, 2013 5:57 PM by Dude! RSS

newbie to understand disks/volumes

phil_xxx Newbie
Currently Being Moderated
just installed my oracle linue 6.4x86 64bit.

my machine has two disks :
a 512 gb SSD
and a 4 tb sata

when I look at disk utility in the desktop it shows my ssd as device /dev/sda

with volumes

EFI System Partition device /dev/sda1 mount point /boot/efi
Linux Basic Data Partition device /dev/sda2 mount point /boot
Linux LVM Partition /dev/sda3

sda3 is not listed with a mount point. also if I type cd /dev/sda3 it tells me this is not a directory.

At this stage I am wanting to create some files on the ssd using the free space ie /dev/sda3

I was wondering if someone could point me in the right direction. do I have to create a new partition or format it somehow.

ps thanks in advance.
  • 1. Re: newbie to understand disks/volumes
    AgneloFerrao Newbie
    Currently Being Moderated
    Hi Phil,

    Have you tried mounting this partition manually?
  • 2. Re: newbie to understand disks/volumes
    Dude! Guru
    Currently Being Moderated
    Linux LVM Partition /dev/sda3
    Partition sda3 is the 3rd partition on disk sda, which is your first disk seen by the controller.
    /dev/sda3 is a special device file for addressing that partition that was created by the kernel.
    The partition sda3 is in use by LVM (Logical Storage Manager).

    Check the following:
    # pvs
      PV         VG       Fmt  Attr PSize  PFree
      /dev/sda3  vg_vm211 lvm2 a--  19.51g    0 
    
    
    # lvscan
      ACTIVE            '/dev/vg_vm211/lv_root' [15.57 GiB] inherit
      ACTIVE            '/dev/vg_vm211/lv_swap' [3.94 GiB] inherit
    The above example show that /dev/sda3 is under LVM control providing the vm211 volume group. The volume group vm211 contains 2 logical volumes: lv_root and lv_swap.

    To mount a LVM volume you could use, e.g.:
    mkdir /mnt/root
    mount /dev/vg_vm211/lv_root /mnt/root
    You might need to read more about Linux LVM.
  • 3. Re: newbie to understand disks/volumes
    alvaromiranda Explorer
    Currently Being Moderated
    provide the output of:

    mount

    df -h

    fdisk-l

    vgdisplay -v

    cat /prod/fstab

    and I will try to explain what the output means

    Alvaro.
  • 4. Re: newbie to understand disks/volumes
    phil_xxx Newbie
    Currently Being Moderated
    thanks you lot. The answers above will form part of my Study today. I will try and reply shortly.
  • 5. Re: newbie to understand disks/volumes
    phil_xxx Newbie
    Currently Being Moderated
    mount

    /dev/mapper/vg_eventhorizon-lv_root on / type ext4 (rw)
    proc on /proc type proc (rw)
    sysfs on /sys type sysfs (rw)
    devpts on /dev/pts type devpts (rw,gid=5,mode=620)
    tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
    /dev/sda2 on /boot type ext4 (rw)
    /dev/sda1 on /boot/efi type vfat (rw,umask=0077,shortname=winnt)
    /dev/mapper/vg_eventhorizon-lv_home on /home type ext4 (rw)
    none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
    sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)

    -- --------------------------------------
    df -h

    Filesystem Size Used Avail Use% Mounted on
    /dev/mapper/vg_eventhorizon-lv_root
    50G 5.6G 42G 12% /
    tmpfs 16G 680K 16G 1% /dev/shm
    /dev/sda2 485M 108M 352M 24% /boot
    /dev/sda1 200M 260K 200M 1% /boot/efi
    /dev/mapper/vg_eventhorizon-lv_home
    4.0T 49G 3.8T 2% /home

    -- --------------------------------------

    fdisk -l

    WARNING: GPT (GUID Partition Table) detected on '/dev/sdb'! The util fdisk doesn't support GPT. Use GNU Parted.


    Disk /dev/sdb: 4000.8 GB, 4000787030016 bytes
    255 heads, 63 sectors/track, 486401 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000

    Device Boot Start End Blocks Id System
    /dev/sdb1 1 267350 2147483647+ ee GPT
    Partition 1 does not start on physical sector boundary.

    WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.


    Disk /dev/sda: 512.1 GB, 512110190592 bytes
    255 heads, 63 sectors/track, 62260 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000

    Device Boot Start End Blocks Id System
    /dev/sda1 1 62261 500107607+ ee GPT

    Disk /dev/mapper/vg_eventhorizon-lv_root: 53.7 GB, 53687091200 bytes
    255 heads, 63 sectors/track, 6527 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000


    Disk /dev/mapper/vg_eventhorizon-lv_swap: 16.8 GB, 16844324864 bytes
    255 heads, 63 sectors/track, 2047 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000


    Disk /dev/mapper/vg_eventhorizon-lv_home: 4441.6 GB, 4441625329664 bytes
    255 heads, 63 sectors/track, 539996 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 4096 bytes
    I/O size (minimum/optimal): 4096 bytes / 4096 bytes
    Disk identifier: 0x00000000

    -- --------------------------------------

    vgdisplay -v

    Finding all volume groups
    Finding volume group "vg_eventhorizon"
    --- Volume group ---
    VG Name vg_eventhorizon
    System ID
    Format lvm2
    Metadata Areas 2
    Metadata Sequence No 4
    VG Access read/write
    VG Status resizable
    MAX LV 0
    Cur LV 3
    Open LV 3
    Max PV 0
    Cur PV 2
    Act PV 2
    VG Size 4.10 TiB
    PE Size 4.00 MiB
    Total PE 1075782
    Alloc PE / Size 1075782 / 4.10 TiB
    Free PE / Size 0 / 0
    VG UUID IYd2Bj-8jMH-R8aU-8SXt-Sifl-1f72-fHThl0

    --- Logical volume ---
    LV Path /dev/vg_eventhorizon/lv_root
    LV Name lv_root
    VG Name vg_eventhorizon
    LV UUID U0RplS-QyW2-FA66-SXok-Tm6S-1PMu-4eHs8M
    LV Write Access read/write
    LV Creation host, time localhost.localdomain, 2013-06-03 09:41:11 +0100
    LV Status available
    # open 1
    LV Size 50.00 GiB
    Current LE 12800
    Segments 1
    Allocation inherit
    Read ahead sectors auto
    - currently set to 256
    Block device 252:0

    --- Logical volume ---
    LV Path /dev/vg_eventhorizon/lv_home
    LV Name lv_home
    VG Name vg_eventhorizon
    LV UUID q3Z8YD-hge0-dcqR-C3Om-yzpH-8vmP-lRV0k7
    LV Write Access read/write
    LV Creation host, time localhost.localdomain, 2013-06-03 09:41:25 +0100
    LV Status available
    # open 1
    LV Size 4.04 TiB
    Current LE 1058966
    Segments 2
    Allocation inherit
    Read ahead sectors auto
    - currently set to 256
    Block device 252:2

    --- Logical volume ---
    LV Path /dev/vg_eventhorizon/lv_swap
    LV Name lv_swap
    VG Name vg_eventhorizon
    LV UUID o3e0sS-NEWe-LjqN-Lzfd-assv-HIvz-f2BSxO
    LV Write Access read/write
    LV Creation host, time localhost.localdomain, 2013-06-03 09:49:57 +0100
    LV Status available
    # open 2
    LV Size 15.69 GiB
    Current LE 4016
    Segments 1
    Allocation inherit
    Read ahead sectors auto
    - currently set to 256
    Block device 252:1

    --- Physical volumes ---
    PV Name /dev/sda3
    PV UUID akTY4G-OLhU-OBNq-2fyJ-btHx-eK1p-RqFT1e
    PV Status allocatable
    Total PE / Free PE 121921 / 0

    PV Name /dev/sdb1
    PV UUID fScpQm-aHEp-yWUY-dw9w-TC5h-z6xZ-ZPsLkD
    PV Status allocatable
    Total PE / Free PE 953861 / 0

    -- --------------------------------------

    cat /prod/fstab
    cat: /prod/fstab: No such file or directory

    i however have

    cat /etc/fstab

    #
    # /etc/fstab
    # Created by anaconda on Mon Jun 3 09:50:48 2013
    #
    # Accessible filesystems, by reference, are maintained under '/dev/disk'
    # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
    #
    /dev/mapper/vg_eventhorizon-lv_root / ext4 defaults 1 1
    UUID=c4e38ff1-e5cb-42b3-95a4-3854053a8913 /boot ext4 defaults 1 2
    UUID=6A64-8352 /boot/efi vfat umask=0077,shortname=winnt 0 0
    /dev/mapper/vg_eventhorizon-lv_home /home ext4 defaults 1 2
    /dev/mapper/vg_eventhorizon-lv_swap swap swap defaults 0 0
    tmpfs /dev/shm tmpfs defaults 0 0
    devpts /dev/pts devpts gid=5,mode=620 0 0
    sysfs /sys sysfs defaults 0 0
    proc /proc proc defaults 0 0


    #mount nas drive as a samba (cifs) drive
    #mount -t cifs -o username=xxx,password=xxx //192.168.0.10/share1 /mnt/spacedebris


    as you can see above I have already mounted my nas.

    regards Phil
  • 6. Re: newbie to understand disks/volumes
    alvaromiranda Explorer
    Currently Being Moderated
    Hi Phil,

    you have 2 hdd, one SSD and one sata 4TB

    If you see the output of the df -h command, you will see you have a / folder where you have some free space

    and a HUGE /home folder with 4TB free

    in Linux (let's say unix)

    you have a interted root hierarchy

    this mean

    on TOP, you have the root file system /

    inside, you will have some folders, say /bin /sbin /lib for the os binaries and libraries, /home for user home directories, /usr for OS software, and so on

    depending the application, is how you want to use the disk space, and that will define a filesystem layout

    some applications use normal filesystem, and some others use block devices, say for example you want to host an oracle database, and for perfomance, you will like to avoid say OS cache, and other stuff that may cause contention..

    there is no an easy simple rule that will make everyone happy, what may work for one, may not work for other.. and partition, preferences are just opinions, ...


    LEt's start with some examples.

    Imagine you have a computer with 10GB of RAM, and a hdd of 500GB

    in a normal system (non uefi one) you usually have a hard drive and you can create partitions on it, for some restrictions in the past, you should have at least 3 partitions to start with

    /boot where the kernel is stored
    / where all the OS is stored
    an special partition in a format, called swap, that, to put it easy is an extention to the RAM, but on disk.. will be slower than RAM, and you can have as many GB you want, however the rule is easy here.. if you use swap (write to swap, read from swap) your system will be slower of not using swap at all, so the best is have swap but not use it..

    on top of the partitions, you initialize it, with a filesystem, in the mount output you will see /home is ext4, that is the default one for OL6.

    if you share a bit of information like what kind of application you want to run here, what kind of use you will do to this machine, that will gave us an idea of what you want to do..

    bear in mind, that virtualization is pretty hot today, so to learn, you can use Virtualbox or any other virtualization tool you have at hand or you are familiar with, and you can create an vm guest, load/install OS, and practice intil you become confortable.

    what's the goal? what oracle or non-oracle product you want to use?

    if you havr time to read, I will suggest read this:

    https://access.redhat.com/site/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/s2-diskpartrecommend-x86.html

    Alvaro.
  • 7. Re: newbie to understand disks/volumes
    Dude! Guru
    Currently Being Moderated
    The output of your fdisk command looks incomplete. However, it is not necessary. Your configuration shows that /dev/sda3 and /dev/sdb1 are both allocated as physical space for LVM.

    LVM uses physical space (PV), which can be a disk or partition, e.g. /dev/sda3 and /dev/sdb1, to build logical groups (LG) and logical volumes. This was automatically done when you installed your OS and used the defaults.

    You do not format and mount any physical LVM partitions (PV), but instead the logical volumes contained within (LV). Please see my previous response.

    I suggest you try to get familiar with basic concepts of LVM. For example:
    http://en.wikipedia.org/wiki/Logical_Volume_Manager_%28Linux%29
  • 8. Re: newbie to understand disks/volumes
    phil_xxx Newbie
    Currently Being Moderated
    thanks guys. Gonna read up on your replies now.
  • 9. Re: newbie to understand disks/volumes
    phil_xxx Newbie
    Currently Being Moderated

    Reply

     

     

    thanks for the above info. I am learning loads. Thank you

     

    So I have 2 disks one 500gb and the other 4tb.

     

     

    Alvaro you were spot on in mentioning Virtualbox.  I have this installed. The machine is both a proof on concept machine and for parallel stream dev (initially).  So I am hoping to run current work on the ssd and offline other stuff to the /home 4tb volume.

     

     

    I initially hope to load Vbox appliances and run these on the ssd.  I expect to have a number of these and back them up / off line them to the /home drive.

     

    From the advice given I understand that to see my physical devices I issue  pvs which shows

     

      /dev/sda3  vg_eventhorizon lvm2 a--       476.25g    0

      /dev/sdb1  vg_eventhorizon lvm2 a--       3.64t    0

     

     

    I now know the volume group is vg_eventhorizon as shown above.

     

     

    lvscan shows my logical volumes on my physical devices

     

      ACTIVE            '/dev/vg_eventhorizon/lv_root' [50.00 GiB] inherit

      ACTIVE            '/dev/vg_eventhorizon/lv_home' [4.04 TiB] inherit

      ACTIVE            '/dev/vg_eventhorizon/lv_swap' [15.69 GiB] inherit

     

     

    so root has taken 50GB and swap 15.69GB. These are on the ssd. There is 511GB unused on the ssd confirmed by

     

    parted -l

     

     

    Model: ATA M4-CT512M4SSD2 (scsi)

    Disk /dev/sda: 512GB

    Sector size (logical/physical): 512B/512B

    Partition Table: gpt

     

    Number  Start   End    Size   File system  Name  Flags

    1      1049kB  211MB  210MB  fat16              boot

    2      211MB   735MB  524MB  ext4

    3      735MB   512GB  511GB                     lvm

     

     

     

     

     

     

    home is on the 4tb drive under /home. I can use this right now by putting files in /home

     

     

    So this is where I remain unclear. To use the remaining space on the ssd  I need to allocate a logical volume to the unused space on the ssd?

  • 10. Re: newbie to understand disks/volumes
    Dude! Guru
    Currently Being Moderated

    A LVM volume can span over several partitions or disks. I don't see the information in your output that shows how your LVM volumes are physically constructed. Please show your output of the following command:

     

    # lvm lvs --segments -o +devices


    The installation defaults are not always useful or appropriate, depending on your current hardware setup. The OS installer will by default use all available space. It might be a good idea for you to reinstall the system and customize the layout.

  • 11. Re: newbie to understand disks/volumes
    phil_xxx Newbie
    Currently Being Moderated

    lvm lvs --segments -o +devices

      LV      VG              Attr      #Str Type   SSize   Devices         

      lv_home vg_eventhorizon -wi-ao---    1 linear   3.64t /dev/sdb1(0)    

      lv_home vg_eventhorizon -wi-ao---    1 linear 410.57g /dev/sda3(12800)

      lv_root vg_eventhorizon -wi-ao---    1 linear  50.00g /dev/sda3(0)    

      lv_swap vg_eventhorizon -wi-ao---    1 linear  15.69g /dev/sda3(117905)

     

     

    so what I want is to use the space on sda3 i guess

  • 12. Re: newbie to understand disks/volumes
    Dude! Guru
    Currently Being Moderated

    Your lv_home volume is using using /dev/sdb1 and /dev/sda3.

     

    /dev/sda3 is not free or available for any other use than your lv_home volume. To remove a physical volume (PV) from a logical volume (LV) is not a trivial task. You will have to use pvmove to move the data from one PV to another, for which you will need an additional device. Then use vgreduce to remove that PV from the lv_home volume group, and finally use pvremove to remove the device from LVM control.

     

    If you are not familiar with LVM and need a solution I'm afraid your best option will be to reinstall the system and to customize the layout the way you need, as previously mentioned, not using the installation defaults. During the installation you can determine which LVM volumes to create and which devices to use.

  • 13. Re: newbie to understand disks/volumes
    phil_xxx Newbie
    Currently Being Moderated

    Thanks dude.  I took some advice and wrote down all the things I set on installation so I can repeat fairly easily.  I'll look into that now.

  • 14. Re: newbie to understand disks/volumes
    phil_xxx Newbie
    Currently Being Moderated

    a bit overdue but wanted to say thanks.  A re-install sorted this.  I installed but only included the ssd in the install so the OS was on the SSD and the remaining space on the ssd was taken up by lvm. I then added the big 4tb drive seperately.  I now have these as seperate drives.  Just what I wanted.

1 2 Previous Next

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points