[Techtalk] xfs repartitioning - solved
Meryll Larkin
mll at alwanza.com
Wed Oct 21 02:30:30 UTC 2015
Okay for those of you who are curious about what would and what would not work:
I could not get the command line version of gparted "parted" native to CentOS6 to cooperate with the syntax I was using. Since no one offered me any syntax other than what I had already tried, I marked this as a "dead end". So IF I had booted to CentOS6 DVD rescue, I have no idea where I would have gone from there. Seems to me that unmounting (umount) the partition on a server where I was the only one capable of logging in was roughly equivalent to booting to single user mode, etc. Native CLI parted on CentOS6 NO GO.
No one from this list suggested using the CentOS6 DVD any way OTHER than booting to rescue mode and since I don't know where I'd go from there: CentOS6 DVD NO GO.
I found 2 other options - one - as someone on the list suggested in fairly vague terms, Logical partitions, another which I found when researching GPARTED: a Live GPARTED BOOT CD.
I did not try the Live Gparted Boot CD - it is possible it would have worked, as it is a more recent version of Gparted than the rpm on CentOS6, plus there is a nice youtube video about how to use it. But I didn't have remote console, and that solution would have involved a trip to the Data Center. I tried the other option first, and that worked.
I subdivided the physical partition into 4 logical volumes. If you do have suggestions or improvements, please do include actual syntax examples.
This is what I did:
# unmount 80T partition
umount /dev/sdb1
# make it into a "physical volume" to prep it for a volume group which can hold logical volumes
pvcreate /dev/sdb1
# create volume group
vgcreate vg00 /dev/sdb1
# create 4 logical volumes out of the volume group (each 25% of 80T)
lvcreate -l 25%VG -nlv_data1 vg00
lvcreate -l 25%VG -nlv_data2 vg00
lvcreate -l 25%VG -nlv_data3 vg00
lvcreate -l 25%VG -nlv_data4 vg00
# format each logical volume with the xfs file system
mkfs.xfs /dev/vg00/lv_data1
mkfs.xfs /dev/vg00/lv_data2
mkfs.xfs /dev/vg00/lv_data3
mkfs.xfs /dev/vg00/lv_data4
# create mount directories for the logical volumes
cd /
mkdir -p data1 data2 data3 data4
# create the mapping of the logical volumes to the directories
# added to /etc/fstab (may revisit this later and change some options)
/dev/vg00/lv_data1 /data1 xfs defaults 0 0
/dev/vg00/lv_data2 /data2 xfs defaults 0 0
/dev/vg00/lv_data3 /data3 xfs defaults 0 0
/dev/vg00/lv_data4 /data4 xfs defaults 0 0
# mount the logical volumes
mount /dev/vg00/lv_data1
mount /dev/vg00/lv_data2
mount /dev/vg00/lv_data3
mount /dev/vg00/lv_data4
Here is the result:
df -hT
Filesystem Type Size Used Avail Use% Mounted on
/dev/mapper/VolGroup-lv_root
ext4 50G 2.2G 45G 5% /
tmpfs tmpfs 32G 0 32G 0% /dev/shm
/dev/sda1 ext4 477M 68M 384M 16% /boot
/dev/mapper/VolGroup-lv_home
ext4 39G 48M 37G 1% /home
/dev/mapper/vg00-lv_data1
xfs 20T 34M 20T 1% /data1
/dev/mapper/vg00-lv_data2
xfs 20T 34M 20T 1% /data2
/dev/mapper/vg00-lv_data3
xfs 20T 34M 20T 1% /data3
/dev/mapper/vg00-lv_data4
xfs 20T 34M 20T 1% /data4
Meryll Larkin
More information about the Techtalk
mailing list