CentOS hdd issues.

  • Thread starter Deleted member 88227
  • Start date
D

Deleted member 88227

Guest
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?
 
That's a bit odd. sda contains /boot on sda1 (so kernel, and grub). While sdb contains everything else.
 
Yeah that's why I am a bit confused on what to do here.
 
For what its worth, I find 'lsblk' prints a much more sane layout of device, partiation and mapped device relationships.
 
For what its worth, I find 'lsblk' prints a much more sane layout of device, partiation and mapped device relationships.

Thanks for the tip.

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
 
That does seem odd. Is this running in a VM or on bare metal? Basically /dev/sda appears mostly unused, other than having your MBR and bootloader.
 
Baremetal.

From what I can gather the datacenter installed the bootloaded on the primary drive sda, but setup the second drive as a LVM and left the empty space on sda alone. No idea why, but I'd like to use that space. As you can see, I need it.

I don't care how it gets used. It can be mounted to /home2 or can be added to the current /root mount point.

I just don't know how. I've never messed with LVM before and I am scared I will screw something up. While I do have backups of what is on the drive. It is nearly 1TB in size. I don't care to upload that amount of data anytime soon.
 
You have three options. Step 1 in all three cases is create a new partition from the unallocated space on /dev/sda

1) Add the partition as PV to your existing root VG and then extend the root LV (and file system) to include the newly available space. This will make the space across the drives appear to be one mapped device and filesystem to userland (your current root device).

2) Use the partition as a PV in a new VG, create a new LV in it, format it and mount it somewhere. This will appear as an additional mapped device and filesystem to your current userland.

3) Forget LVM, and just format the new partition and mount it. Same as #2 but the partition won't be managed by LVM.

Personally I hate dealing with LVM on simple server setups, so I'd be inclined to go with 3 but since you are already using LVM you may wish to do 1 or 2.
 
I ended up just doing #3. Partitioned the unallocated space and mounted it to /home2. Forgot to post what I had done.

Now I'm no longer at 97% on the other drive so I will stop getting emails about it. Haha!

Although with all this new space I want to host some more game servers on it now. I've got ~25 servers on the server as it is. What's another 25?
 
Can you share with us what host you're using for this server? Thanks!
 
Back
Top