Understanding volumes and hard drives


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
Old 01-03-2019
Understanding volumes and hard drives

Ok so i thought i was smart but i can tell I need some help. I am playing around with understanding lvm and adding disks to a linux box. I added a disk and then ran what i thought were commands to add this disk to the box but I think I messed up and would like some help. My question is did i just add this disk to the current LV and now i just need to resize the it? I tried to get this to mount but it comes back with the following error. Thanks in advance and yes you can make fun of me for not knowing this stuff but hye I gotta learn somehow right?

mount error..
Code:
mount -t xfs /dev/mapper/ol-lv_oradata  /mnt/drives/oradata
mount: wrong fs type, bad option, bad superblock on /dev/mapper/ol-lv_oradata,
       missing codepage or helper program, or other error

In some cases useful info is found in syslog - try
dmesg | tail or so.

here are my outputs.
Code:
df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/ol-root   27G   22G  5.1G  81% /
devtmpfs             1.4G     0  1.4G   0% /dev
tmpfs                1.4G   32M  1.4G   3% /dev/shm
tmpfs                1.4G  9.6M  1.4G   1% /run
tmpfs                1.4G     0  1.4G   0% /sys/fs/cgroup
/dev/sda1            497M  282M  216M  57% /boot
tmpfs                276M   60K  276M   1% /run/user/54321


 ls -ls /dev/sd*
0 brw-rw----. 1 root disk 8,  0 Jan  2 16:34 /dev/sda
0 brw-rw----. 1 root disk 8,  1 Jan  2 16:34 /dev/sda1
0 brw-rw----. 1 root disk 8,  2 Jan  3 13:53 /dev/sda2
0 brw-rw----. 1 root disk 8, 16 Jan  3 13:50 /dev/sdb  <-- this is the disk I added
0 brw-rw----. 1 root disk 8, 17 Jan  3 13:53 /dev/sdb1 <-- this is the disk I added

fdisk -l

Disk /dev/sda: 32.2 GB, 32212254720 bytes, 62914560 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0003e72b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1026047      512000   83  Linux
/dev/sda2         1026048    62914559    30944256   8e  Linux LVM

Disk /dev/sdb: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x9a45daa3

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048   104857599    52427776   83  Linux

Disk /dev/mapper/ol-root: 28.4 GB, 28420603904 bytes, 55508992 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/ol-swap: 3221 MB, 3221225472 bytes, 6291456 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/ol-lv_oradata: 53.7 GB, 53687091200 bytes, 104857600 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

 lvmdiskscan
  /dev/ram0          [      16.00 MiB] 
  /dev/ol/root       [     <26.47 GiB] 
  /dev/ram1          [      16.00 MiB] 
  /dev/sda1          [     500.00 MiB] 
  /dev/ol/swap       [       3.00 GiB] 
  /dev/ram2          [      16.00 MiB] 
  /dev/sda2          [      29.51 GiB] LVM physical volume
  /dev/ol/lv_oradata [      50.00 GiB] 
  /dev/ram3          [      16.00 MiB] 
  /dev/ram4          [      16.00 MiB] 
  /dev/ram5          [      16.00 MiB] 
  /dev/ram6          [      16.00 MiB] 
  /dev/ram7          [      16.00 MiB] 
  /dev/ram8          [      16.00 MiB] 
  /dev/ram9          [      16.00 MiB] 
  /dev/ram10         [      16.00 MiB] 
  /dev/ram11         [      16.00 MiB] 
  /dev/ram12         [      16.00 MiB] 
  /dev/ram13         [      16.00 MiB] 
  /dev/ram14         [      16.00 MiB] 
  /dev/ram15         [      16.00 MiB] 
  /dev/sdb1          [     <50.00 GiB] LVM physical volume


Last edited by vbe; 01-03-2019 at 05:09 PM.. Reason: code tags
# 2  
Old 01-03-2019
Maybe if you explained, wrote what you did( command you passed...), could we understand what is going on, and it is helpful to give more details about your architecture /OS version
# 3  
Old 01-03-2019
Code:
mkfs  -t xfs -f /dev/sdb
  fdisk /dev/sdb
  ls -la /dev/sdb*
  pvcreate /dev/sdb1
  vgextend ol /dev/sdb1
  lvcreate -L 50GB -n lv_oradata ol
  lvdisplay ol/lv_oradata
  mkfs -t xfs -f /dev/ol/lv_oradata

Moderator's Comments:
Mod Comment Please use CODE-tags when posting code, data or output from a terminal. Thank you.

Last edited by bakunin; 01-03-2019 at 10:09 PM..
# 4  
Old 01-03-2019
Quote:
Originally Posted by cptkirkh
Code:
mkfs  -t xfs -f /dev/sdb
  fdisk /dev/sdb
  ls -la /dev/sdb*
  pvcreate /dev/sdb1
  vgextend ol /dev/sdb1
  lvcreate -L 50GB -n lv_oradata ol
  lvdisplay ol/lv_oradata
  mkfs -t xfs -f /dev/ol/lv_oradata

If these commands have been entered in the order you posted them then you indeed seem not to understand what disks, volumes, partitions and filesystems are. You might profit from reading this little introduction i once wrote. This was for AIX, but the Linux LVM was built after the AIX LVM and the concepts are absolutely the same - just the commands are a little bit different.

I hope this helps.

bakunin

Last edited by RavinderSingh13; 01-03-2019 at 11:24 PM..
This User Gave Thanks to bakunin For This Post:
cptkirkh (01-04-2019)
# 5  
Old 01-04-2019
Yes, that helped me understand what I did wrong. It looks like from your other post that since i created a file system at that time it created an underlying LV. thanks for the help. I will read more to see what needs to be done to resolve this issue.

--- Post updated at 02:21 PM ---

Thank you for your help. After reading your other post I understand my error. I have removed all of my issues and successfully added and extended the logical volume on my root. Now i am going to try and add another disk and create a new logical volume and see how it goes.
# 6  
Old 01-04-2019
Quote:
Originally Posted by cptkirkh
After reading your other post I understand my error. I have removed all of my issues and successfully added and extended the logical volume on my root. Now i am going to try and add another disk and create a new logical volume and see how it goes.
That is very good news and i am glad you had success. If you encounter another problem don't hesitate to ask.

bakunin
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Need Hardware help on a RP4440 that lost the RTC and does not see both hard drives mrmurdock HP-UX 2 2 Weeks Ago 02:22 PM
Solaris 8 - Accessing Hard Drives ssabet Solaris 5 12-15-2016 03:26 AM
Hard Drives Undetected on My Machine - But Mounts on All Other Machines jacobs.smith Ubuntu 20 08-18-2015 03:35 PM
Create LVM of 2 Hard Drives while installing Centos 6.4. purushottamaher Linux 1 04-28-2014 06:40 AM
Trying to boot Solaris without hard drives in T5220 nerdboy Solaris 4 09-03-2013 05:04 PM
Hard Drives and MBR Lost in Cyberia Hardware 3 06-04-2013 06:28 PM
Reinstall old hard drives stu1811 Solaris 7 05-04-2013 10:58 AM
Set internal hard drives unaccessible to imager traustic UNIX for Dummies Questions & Answers 9 01-23-2012 12:09 PM
Help adding new hard drives Katkota Filesystems, Disks and Memory 3 10-10-2009 04:57 PM
formating and repartitioning an external hard drives seyiisq Solaris 2 05-18-2009 08:22 AM
How do I determine the hard drives in /dev/dsk in OpenSolaris? sqa777 Solaris 2 12-23-2008 05:15 PM
No Hard Drives Have Been Found tamcomng Linux 2 07-21-2008 08:30 AM
automatic copying files from external hard drives backman4sakn Filesystems, Disks and Memory 0 08-12-2005 06:11 PM
Hard drives franruiz UNIX for Dummies Questions & Answers 3 01-13-2004 05:13 PM