LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-07-2014, 01:10 PM   #1
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Rep: Reputation: 32
Help mounting hard drive...


I've done this before in the past without much issue, but the company I've rented my dedicated box from this time seems to have done something I'm not familiar with on the hard drives installed on the box.

I'm running CENTOS 6.6 x86_64. Here are some useful commands that will show what I'm working with.

Code:
root@server1 [~]# fdisk -l

Disk /dev/sdb: 1000.2 GB, 1000204886016 bytes
81 heads, 63 sectors/track, 382818 cylinders
Units = cylinders of 5103 * 512 = 2612736 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0001674d

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1               1      382819   976760832+  83  Linux

Disk /dev/sda: 1000.2 GB, 1000204886016 bytes
255 heads, 31 sectors/track, 247125 cylinders
Units = cylinders of 7905 * 512 = 4047360 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0003d3c1

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          66      256000   83  Linux

Disk /dev/mapper/vg-root: 990.7 GB, 990694604800 bytes
255 heads, 63 sectors/track, 120445 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-swap: 8422 MB, 8422162432 bytes
255 heads, 63 sectors/track, 1023 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-tmp: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 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
Code:
root@server1 [~]# parted -l
Model: ATA WDC WD1002FBYS-0 (scsi)
Disk /dev/sda: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End    Size   Type     File system  Flags
 1      1049kB  263MB  262MB  primary  ext2         boot


Model: ATA WDC WD1002FBYS-0 (scsi)
Disk /dev/sdb: 1000GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start   End     Size    Type     File system  Flags
 1      1049kB  1000GB  1000GB  primary


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/vg-tmp: 1074MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system  Flags
 1      0.00B  1074MB  1074MB  ext4


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/vg-swap: 8422MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End     Size    File system     Flags
 1      0.00B  8422MB  8422MB  linux-swap(v1)


Model: Linux device-mapper (linear) (dm)
Disk /dev/mapper/vg-root: 991GB
Sector size (logical/physical): 512B/512B
Partition Table: loop

Number  Start  End    Size   File system  Flags
 1      0.00B  991GB  991GB  ext4
Code:
root@server1 [~]# df -h
Filesystem           Size  Used Avail Use% Mounted on
/dev/mapper/vg-root  909G  832G   31G  97% /
tmpfs                7.8G     0  7.8G   0% /dev/shm
/dev/sda1            243M   85M  145M  37% /boot
/dev/mapper/vg-tmp  1008M   35M  922M   4% /tmp
Hope this helps.

It seems that sdb is the primary disk where the operating system is installed, while sda is the empty disk but it seems something might be stored on it? Partition table or something maybe?
 
Old 12-07-2014, 01:35 PM   #2
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
The output from df shows quite clearly that /dev/sda1 is your boot partition. Your OS is installed on /dev/sdb in LVM logical volumes. Since the version of GRUB used in CentOS 6 does not allow the boot files to be in LVM volumes, you have that separate boot partition. The remainder of /dev/sda is not currently allocated to partitions.
 
Old 12-07-2014, 01:42 PM   #3
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
So how would I go about in partitioning and mounting the remainder of sda? I've never done anything with LVM. Could I extend the LVM to include the remainder of sda? I'm so confused.
 
Old 12-07-2014, 01:49 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
It does seem a bit strange to have an entire drive with only /boot (sda1). As stated the rest of sda is unallocated space i.e. not partitioned so nothing to mount at the moment. Several things you can do like create a LVM partition and add the space to your vg-root or just a separate partition for data.

There is a GUI tool system-config-lvm that might help a bit...

Last edited by michaelk; 12-07-2014 at 01:55 PM.
 
Old 12-07-2014, 02:07 PM   #5
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
I don't have any GUI on the system. I only log in via shell using Putty. Unless I am misunderstanding you I don't think I can use system-config-lvm without first installings some sort of GUI on the system first.
 
Old 12-07-2014, 03:08 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Sorry your correct it is a gui tool.
 
Old 12-07-2014, 08:08 PM   #7
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
You can use any partitioning tool to create a second partition using the rest of /dev/sda. To do this online, you will first need to unmount the /boot partition so that the kernel will accept the partitioning update. (/boot is not needed during normal operation -- you can remount it afterward.) You can then use the vgextend command to include the new /dev/sda2 partition in the existing "vg" volume group
Code:
vgextend -v vg /dev/sda2
and either create new LVs there or extend the existing "vg-root" LV. Your choice. I would at least create a separate LV and filesystem for /home rather than keep everything in your root filesystem the way it is now, but how you allocate your storage is up to you.
 
Old 12-08-2014, 06:54 AM   #8
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
So I need to use

Code:
umount /boot
To unmount /boot then I need to just type

Code:
vgextend -v vg /dev/sda2
and I assume follow directions after that?

Last edited by Skillz; 12-08-2014 at 11:27 AM.
 
Old 12-08-2014, 11:47 AM   #9
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
Okay so I created a partition with the empty space on /dev/sda:

Code:
root@server1 [~]# lsblk
NAME               MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sdb                  8:16   0 931.5G  0 disk
└─sdb1               8:17   0 931.5G  0 part
  ├─vg-root (dm-0) 253:0    0 922.7G  0 lvm  /
  ├─vg-swap (dm-1) 253:1    0   7.9G  0 lvm  [SWAP]
  └─vg-tmp (dm-2)  253:2    0     1G  0 lvm  /tmp
sda                  8:0    0 931.5G  0 disk
├─sda1               8:1    0   250M  0 part /boot
└─sda2               8:2    0 931.3G  0 part
Now how do I get sda2 as part of the lvm or vg?

edit
After looking over that table, seems I might have done something wrong. It doesn't say lvm nedt to sda2. Was I supposed to partition it as a logical volume or something? or will it change once i add it to the vg? im so confused. I think im gonna just mount it to /home2 so i can use the space and be done with it.

Last edited by Skillz; 12-08-2014 at 11:52 AM.
 
Old 12-08-2014, 12:01 PM   #10
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
You need to run the "vgextend -v vg /dev/sda2". That should make /dev/sda2 show up when you run "pvs" and should make "vgs" show that volume group "vg" is now nearly 2TB in size with ~900GB free for use in adding or expanding LVs.

BTW, I should have mentioned that it would be nice to set the type of partition /dev/sda2 to "8e" (Linux LVM). It doesn't really matter to the OS, but it's a nice reminder to humans of what's there when they look at the partition table. Don't worry about any "device busy" or recommendations to reboot. That change isn't anything the kernel cares about.
 
Old 12-08-2014, 12:01 PM   #11
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
I just formatted it and mounted it to /home2. Now I can finally make use of this space.
 
Old 12-08-2014, 12:51 PM   #12
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,779

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
That will work, too. Nothing says you have to use LVM.
 
Old 12-08-2014, 01:20 PM   #13
Skillz
Member
 
Registered: Sep 2007
Posts: 252

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by rknichols View Post
That will work, too. Nothing says you have to use LVM.
I was under the initial impression that I couldn't do it the "old" way, but after doing some reading on the subject I figured I'd give it a shot and sure enough it worked.

Guess having a flat tire this AM and missing work was still productive after all. Been needing to get this done for months now.
 
Old 12-08-2014, 01:42 PM   #14
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
You can mark the thread as solved via the thread tools at the top of the page.

To bad about the tire...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mounting new hard drive eliassal Linux - Newbie 2 07-03-2010 09:40 AM
Help on mounting Hard Disk Drive and CD-ROM drive in Dapper. ussr_1991 Ubuntu 2 08-18-2007 11:33 PM
Need help mounting a hard drive cevilgenius Linux - Newbie 15 04-12-2005 02:35 PM
Mounting a Hard Drive Garoth Linux - Software 9 11-11-2004 08:47 PM
Mounting hard drive Runt888 Linux - Newbie 1 08-29-2001 02:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 07:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration