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
adding harddrive
-
- Posts: 2019
- Joined: 2015/02/17 15:14:33
- Location: Bulgaria
- Contact:
Re: adding harddrive
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.
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.
-
- Posts: 11
- Joined: 2017/06/07 18:53:14
Re: adding harddrive
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....
-
- Posts: 1522
- Joined: 2014/05/21 20:16:00
- Location: Central New York, USA
Re: adding harddrive
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:
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
-
- Posts: 11
- Joined: 2017/06/07 18:53:14
Re: adding harddrive
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
/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
Re: adding harddrive
No. No labels required. The UUIDs are more than fine.
and
mean that you can use in /etc/fstab:
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.
Code: Select all
/dev/sdc1 /netzwerk/freigabe1 ext4 defaults 1 2
/dev/sdb1 /netzwerk/freigabe2 ext4 defaults 1 2
Code: Select all
/dev/sdb1: UUID="140f16fc-ac76-4ec6-8c5c-845939a7befe" TYPE="ext4"
/dev/sdc1: UUID="d432f41c-e870-49d5-897f-352119f2540f" TYPE="ext4"
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 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.