Linux - HardwareThis forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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?
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.
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.
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...
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.
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.