How to add 8 Tera unallocated /dev/sda memory to Disk Space

Issues related to applications and software problems
JohnReese
Posts: 10
Joined: 2021/02/27 16:39:04

How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by JohnReese » 2021/02/27 16:46:21

Hi, I have searched and viewed multiple guides but none of them work on my case. I have a CentOs7 Raid 1 and I have completely filled the memory of my webserver. I would like to add the 8 terabyte HDD and be able to upload all my data. How can I do? The hdd has never been formatted or partitioned.

I bought a webserver from a third party and can only access it via bash but not ask for support.
Thanks

Here if i pressed on bash fdisk -l

Code: Select all

Disk /dev/nvme0n1: 512.1 GB, 512110190592 bytes, 1000215216 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: 0x000f3a17

        Device Boot      Start         End      Blocks   Id  System
/dev/nvme0n1p1   *        2048     2099199     1048576   fd  Linux raid autodetect
/dev/nvme0n1p2         2099200  1000214527   499057664   fd  Linux raid autodetect

Disk /dev/nvme1n1: 500.1 GB, 500107862016 bytes, 976773168 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: 0x00079732

        Device Boot      Start         End      Blocks   Id  System
/dev/nvme1n1p1   *        2048     2099199     1048576   fd  Linux raid autodetect
/dev/nvme1n1p2         2099200   976773119   487336960   fd  Linux raid autodetect

Disk /dev/md0: 1071 MB, 1071644672 bytes, 2093056 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/md1: 498.9 GB, 498897780736 bytes, 974409728 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

WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.

Disk /dev/sda: 8001.6 GB, 8001563222016 bytes, 15628053168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes
I/O size (minimum/optimal): 4096 bytes / 4096 bytes
Disk label type: gpt
Disk identifier: 959A27A5-409A-4C7A-9E35-A511C12703C2


#         Start          End    Size  Type            Name

Disk /dev/mapper/Volume00-root: 450.9 GB, 450887680000 bytes, 880640000 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/Volume00-swap: 4294 MB, 4294967296 bytes, 8388608 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/Volume00-tmp: 4294 MB, 4294967296 bytes, 8388608 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
And here if i pressed of bash df -h

Code: Select all

Filesystem                 Size  Used Avail Use% Mounted on
devtmpfs                    16G     0   16G   0% /dev
tmpfs                       16G     0   16G   0% /dev/shm
tmpfs                       16G  393M   16G   3% /run
tmpfs                       16G     0   16G   0% /sys/fs/cgroup
/dev/mapper/Volume00-root  414G  393G  167M 100% /
/dev/mapper/Volume00-tmp   3.9G   17M  3.6G   1% /tmp
/dev/md0                   990M  152M  772M  17% /boot
tmpfs                      3.2G     0  3.2G   0% /run/user/0

Whoever
Posts: 1357
Joined: 2013/09/06 03:12:10

Re: How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by Whoever » 2021/02/28 20:17:26

Please post the results of running the command:
lsblk

JohnReese
Posts: 10
Joined: 2021/02/27 16:39:04

Re: How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by JohnReese » 2021/03/01 08:27:48

Code: Select all

NAME                MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                   8:0    0   7.3T  0 disk
nvme0n1             259:0    0   477G  0 disk
├─nvme0n1p1         259:1    0     1G  0 part
│ └─md0               9:0    0  1022M  0 raid1 /boot
└─nvme0n1p2         259:2    0   476G  0 part
  └─md1               9:1    0 464.7G  0 raid1
    ├─Volume00-root 253:0    0 419.9G  0 lvm   /
    ├─Volume00-swap 253:1    0     4G  0 lvm   [SWAP]
    └─Volume00-tmp  253:2    0     4G  0 lvm   /tmp
nvme1n1             259:3    0 465.8G  0 disk
├─nvme1n1p1         259:4    0     1G  0 part
│ └─md0               9:0    0  1022M  0 raid1 /boot
└─nvme1n1p2         259:5    0 464.8G  0 part
  └─md1               9:1    0 464.7G  0 raid1
    ├─Volume00-root 253:0    0 419.9G  0 lvm   /
    ├─Volume00-swap 253:1    0     4G  0 lvm   [SWAP]
    └─Volume00-tmp  253:2    0     4G  0 lvm   /tmp

tunk
Posts: 1205
Joined: 2017/02/22 15:08:17

Re: How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by tunk » 2021/03/01 15:36:21

Here's a short version:
1. Create a partition: fdisk /dev/sda
2. Create a file system on that partition: mkfs -t xfs /dev/sda1
3. Create a mount point
4. Mount the file system (command line + /etc/fstab)
5. Stop services/etc. that access old data
6. Move old data to new filesystem
7. Change any setup so that it uses the new file system (including selinux)
8. Start services/etc. and check if all works

YMMV and this may not be accurate; do a web search for
each step, and come back when you have specific questions.

Edit: fdisk doesn't support disks larger than 2TB,
use this instead: parted /dev/sda

JohnReese
Posts: 10
Joined: 2021/02/27 16:39:04

Re: How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by JohnReese » 2021/03/01 16:45:38

Ok, thanks. Can you send me the link to a guide that explains step by step how to do it? Thanks

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by TrevorH » 2021/03/01 18:13:44

Also be aware that the rest of your storage is set up to use RAID 1 so you are protected against single drive failure for the data on those. However your new disk is just a disk with no redundancy so any disk problem on there and all the data on it will be toast.

Your current drive is completely empty and has no partition table. The first step is to partition it and you should make sure that the partition(s) you create on the disk are aligned to boundaries that are divisible by 4096 or the drive will be extremely slow to write data.

What are you intending to use this new drive for?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

User avatar
jlehtone
Posts: 4523
Joined: 2007/12/11 08:17:33
Location: Finland

Re: How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by jlehtone » 2021/03/01 19:58:52

tunk wrote:
2021/03/01 15:36:21
Edit: fdisk doesn't support disks larger than 2TB,
As fdisk says:
"WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion."

There is gdisk that is similar to fdisk, but supports primarily GPT.

One could throw in LVM. Even go fancy and use part of NVME as cache for the HDD. (Obviously more parts that could break is more risky.)


Least SELinux/webserver hassle you get by mounting where the data was.
If data is now in /var/www
* Create the new filesystem and mount it temporarily elsewhere. For example: /mnt/newwww
* Stop webserver
* Move content of /var/www/ into /mnt/newwww/
* umount /mnt/newwww
* Mount new filesystem to /var/www
* restorecon -r /var/www
* restart webserver
After this operation files still seem to be in /var/www, but physically they are in the new filesystem volume

JohnReese
Posts: 10
Joined: 2021/02/27 16:39:04

Re: How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by JohnReese » 2021/03/01 20:25:35

TrevorH wrote:
2021/03/01 18:13:44
Also be aware that the rest of your storage is set up to use RAID 1 so you are protected against single drive failure for the data on those. However your new disk is just a disk with no redundancy so any disk problem on there and all the data on it will be toast.

Your current drive is completely empty and has no partition table. The first step is to partition it and you should make sure that the partition(s) you create on the disk are aligned to boundaries that are divisible by 4096 or the drive will be extremely slow to write data.

What are you intending to use this new drive for?
To store data

JohnReese
Posts: 10
Joined: 2021/02/27 16:39:04

Re: How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by JohnReese » 2021/03/01 20:31:23

tunk wrote:
2021/03/01 15:36:21
Here's a short version:
1. Create a partition: fdisk /dev/sda
2. Create a file system on that partition: mkfs -t xfs /dev/sda1
3. Create a mount point
4. Mount the file system (command line + /etc/fstab)
5. Stop services/etc. that access old data
6. Move old data to new filesystem
7. Change any setup so that it uses the new file system (including selinux)
8. Start services/etc. and check if all works

YMMV and this may not be accurate; do a web search for
each step, and come back when you have specific questions.

Edit: fdisk doesn't support disks larger than 2TB,
use this instead: parted /dev/sda
1) Done
2) Done
3) How can i do it?

JohnReese
Posts: 10
Joined: 2021/02/27 16:39:04

Re: How to add 8 Tera unallocated /dev/sda memory to Disk Space

Post by JohnReese » 2021/03/01 20:55:07

I have format my server, now i'm ready to redo all.
How can i format, partition and mount my 8 tera hdd to move storage and install apache webserver on centos 7 web server?
Can someone tell me all steps?

I have followed this guide https://www.tecmint.com/add-disk-larger ... ing-linux/ but now i can't access to my server, there's a network error :?
now I'm forced to reformat it again. Could someone please provide me with the right step-by-step steps?

Post Reply