Hi Trevor,
Just want to thank again for all your help! It is making the process a lot easy! I followed the instruction, but not sure if I get to where I need to go.
lvchange -an /dev/mapper/vg1-data
-------- Did that. I have to comment out line in /etc/fstab first, and then unmount /localdata
lvremove /dev/mapper/vg1-data
-------- Did that.
vgremove vg1
-------- Did that.
pvremove /dev/sdb1
-------- Did that.
then use your favourite partitioning tool to delete what's there now, fix any problems and rewrite it all as one big partition - /dev/sdb1. That may want a reboot but probably won't as the device should have been made inactive by the previous commands. Then
------- Did that. I used parted to delete the partition, and create one big partition with this
------- Now this is what it looks like
Code: Select all
[root@ch-rel-bap-p01 ~]# parted /dev/sdb
GNU Parted 3.1
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
Model: VMware Virtual disk (scsi)
Disk /dev/sdb: 537GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 1049kB 537GB 537GB primary
pvcreate /dev/sdb1
---- did that.
vgcreate vg1 /dev/sdb1
--- did that
lvcreate -n data -l 100%FREE vg1
--- did that
You said the next step is to create a filesystem on it with mkfs. but the file system seems to have been created already when I run lsblk -f
Code: Select all
[root@ch-rel-bap-p01 localdata]# lsblk -f
NAME FSTYPE LABEL UUID MOUNTPOINT
fd0
sda
├─sda1 xfs 6c0b9289-06c6-408e-896e-bbe99c746967 /boot
├─sda2 swap 9c698bbd-692f-4837-a9b6-7b2f76e8f7d6 [SWAP]
└─sda3 LVM2_member GnytsI-WhF3-i0Y7-oV69-YclU-wYmd-UFCF0V
└─centos-root xfs 148ed65f-7910-4e70-a0ef-8ae46245f1c0 /
sdb
└─sdb1 LVM2_member UvYPOK-j86v-iaJZ-wJgJ-FYsY-XjZN-2E9dSS
└─vg1-data xfs aa5cdf0e-ca89-451a-827c-7d819173d15d
sdc
sr0
Do I still need to create the filesystem with mkfs. I got an warning when I tried. Not sure when the file system was created, maybe with "mkart primary xfs 0GB 537GB?"
Code: Select all
[root@ch-rel-bap-p01 localdata]# mkfs -t xfs /dev/vg1/data
mkfs.xfs: /dev/vg1/data appears to contain an existing filesystem (xfs).
mkfs.xfs: Use the -f option to force overwrite.
Now I just needed to mount /localdata to /dev/mapper/vg1-data, can I just uncomment this line in /etc/fstab?
Code: Select all
/dev/mapper/vg1-data /localdata xfs defaults 0 0
I tried that, but then it shows 100GB only, not the 500 GB. I must be missing something there. Do I have to run mount?
Code: Select all
[root@ch-rel-bap-p01 ~]# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
fd0 2:0 1 4K 0 disk
sda 8:0 0 50G 0 disk
├─sda1 8:1 0 500M 0 part /boot
├─sda2 8:2 0 5G 0 part [SWAP]
└─sda3 8:3 0 44.5G 0 part
└─centos-root 253:0 0 44.5G 0 lvm /
sdb 8:16 0 500G 0 disk
└─sdb1 8:17 0 500G 0 part
└─vg1-data 253:1 0 500G 0 lvm /localdata
sdc 8:32 0 64G 0 disk
sr0 11:0 1 1024M 0 rom
[root@ch-rel-bap-p01 ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/centos-root xfs 45G 1.4G 44G 3% /
devtmpfs devtmpfs 16G 0 16G 0% /dev
tmpfs tmpfs 16G 0 16G 0% /dev/shm
tmpfs tmpfs 16G 8.5M 16G 1% /run
tmpfs tmpfs 16G 0 16G 0% /sys/fs/cgroup
/dev/mapper/vg1-data xfs 100G 33M 100G 1% /localdata
/dev/sda1 xfs 497M 260M 238M 53% /boot
tmpfs tmpfs 3.2G 0 3.2G 0% /run/user/0
I think I am almost there... Thanks again Trevor!
xkxTnT