adding harddrive

General support questions
Post Reply
heinzketchup3920
Posts: 11
Joined: 2017/06/07 18:53:14

adding harddrive

Post by heinzketchup3920 » 2017/09/19 09:49:22

Hi ,

how do i add a harddrive in a running centos7?
i did it once, and the server does not start any more,i was in a rescue console, so i removed the harddrive, and the server starts normal....what did i wrong?
perhaps the server could not find the root file system, because the new harddrive confused the filesystems?

Thx for any advice...

sincerly yours
stefan

hunter86_bg
Posts: 2019
Joined: 2015/02/17 15:14:33
Location: Bulgaria
Contact:

Re: adding harddrive

Post by hunter86_bg » 2017/09/19 12:17:27

What is the end goal, what are you trying to accomplish ? How did you add this disk? Is this a physical or virtual machine ?
You can add disks, you can rescan the scsi bus(es) to recognise those disks, you can add them to the LVM and use them immediately without any downtime.

heinzketchup3920
Posts: 11
Joined: 2017/06/07 18:53:14

Re: adding harddrive

Post by heinzketchup3920 » 2017/09/19 12:20:55

thx....it is a physical disk...i want to add it to get more space...it is a 750gb sata-harddrive...i want to add it to 2 existing disks in the server...1 is an ide drive, 1 an sata drive....

lightman47
Posts: 1521
Joined: 2014/05/21 20:16:00
Location: Central New York, USA

Re: adding harddrive

Post by lightman47 » 2017/09/20 19:28:23

Here's the deal (for me, anyway) - whenever you plug in a SATA drive, all the "SDx" 'assignments' change - therefore the boot drive may no longer be the boot drive that the system attempts to mount.

My work around was to Label all my added drives, then have the system mount them by their LABELs instead of the UUID/location. For instance, in my server with 3 additional drives labelled 2tb1, 4tb1, and 4tb2, my /etc/fstab entries (after the /dev/mapper/ stuff) look like:

Code: Select all

LABEL=2tb1 /mnt/2tb1 ext4 defaults 1 2
LABEL=4tb1 /mnt/4tb1 ext4 defaults 1 2
LABEL=4tb2 /mnt/4tb2 ext4 defaults 1 2

heinzketchup3920
Posts: 11
Joined: 2017/06/07 18:53:14

Re: adding harddrive

Post by heinzketchup3920 » 2017/09/21 09:37:08

my actual fstab like this:

/dev/mapper/cl-root / xfs defaults 0 0
UUID=15b322fe-b957-4a21-8fd6-9aaa6cee74e6 /boot xfs defaults 0 0
/dev/mapper/cl-home /home xfs defaults 0 0
/dev/mapper/cl-swap swap swap defaults 0 0
/dev/sdc1 /netzwerk/freigabe1 ext4 defaults 1 2
/dev/sdb1 /netzwerk/freigabe2 ext4 defaults 1 2


so i may change this to:

/dev/mapper/cl-root / xfs defaults 0 0
UUID=15b322fe-b957-4a21-8fd6-9aaa6cee74e6 /boot xfs defaults 0 0
/dev/mapper/cl-home /home xfs defaults 0 0
/dev/mapper/cl-swap swap swap defaults 0 0
LABEL=500GB /netzwerk/freigabe1 ext4 defaults 1 2
LABEL=1000GB /netzwerk/freigabe2 ext4 defaults 1 2
LABEL=750GB /netzwerk/freigabe3 (new HD) ext4 defaults 1 2


this is my blkid:

[root@localhost ~]# blkid
/dev/sda1: UUID="15b322fe-b957-4a21-8fd6-9aaa6cee74e6" TYPE="xfs"
/dev/sda2: UUID="cLro7m-LtPu-LiMY-HabT-pNs0-UQ0v-6G2JLd" TYPE="LVM2_member"
/dev/sdb1: UUID="140f16fc-ac76-4ec6-8c5c-845939a7befe" TYPE="ext4"
/dev/sdc1: UUID="d432f41c-e870-49d5-897f-352119f2540f" TYPE="ext4"
/dev/mapper/cl-root: UUID="77c2af62-5f02-492a-856c-801a38c530e1" TYPE="xfs"
/dev/mapper/cl-swap: UUID="b4cf2b94-fcef-4ee6-8dd4-72f409b8ab5a" TYPE="swap"
/dev/sdd1: PARTLABEL="Microsoft reserved partition" PARTUUID="8d41d9d8-a8b9-4f4e-a08d-ed880106ac7b"
/dev/sdd2: LABEL="4terabyte" UUID="FEE269A6E26963BD" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="7a2e4c05-e0ab-4989-9e99-c4b5061d01e6"
/dev/mapper/cl-home: UUID="9ffb9b84-e058-4a8f-bcde-3b62316d301f" TYPE="xfs"

so before all, i must set the labels (like this?):

e2label /dev/sdb1 /1000GB
e2label /dev/sdc1 /500GB
e2label /dev/sde1 /750GB (but the drive is not yet installed...)


stefan

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

Re: adding harddrive

Post by jlehtone » 2017/09/21 10:25:35

No. No labels required. The UUIDs are more than fine.

Code: Select all

/dev/sdc1 /netzwerk/freigabe1 ext4 defaults 1 2
/dev/sdb1 /netzwerk/freigabe2 ext4 defaults 1 2
and

Code: Select all

/dev/sdb1: UUID="140f16fc-ac76-4ec6-8c5c-845939a7befe" TYPE="ext4"
/dev/sdc1: UUID="d432f41c-e870-49d5-897f-352119f2540f" TYPE="ext4"
mean that you can use in /etc/fstab:

Code: Select all

UUID=d432f41c-e870-49d5-897f-352119f2540f /netzwerk/freigabe1 ext4 defaults 1 2
UUID=140f16fc-ac76-4ec6-8c5c-845939a7befe /netzwerk/freigabe2 ext4 defaults 1 2
If you can boot fine after that change, then you can physically add the next HDD.

If you still can boot fine with the extra HDD attached, then it is time to partition & create filesystem(s) on the drive (or use it to extend the LVM VG).

Once you have filesystem(s) on the disk and mountable, then it is time to append to /etc/fstab. Not before.

Post Reply