It depends what you need to accomplish. If you need to relocate existing data, you will essentially need to copy all files to another device, then erase and reparation the original device and copy the data back.
If you "simply" need to resize your system disk:
Thanks for replying. There is no lvm. and the disk partition is a brand new one. just want to separate different data
Well, I can only know what you have or try to accomplish from the information you have provided.
If you have a rather unusual task or setup, you will need to post more details. There is no command to split a device and file system. You will have to do it manually, for which more information will be required, such as:
Is it a system disk? Do you need to relocate data? etc. etc.
There is no information on the said disk at all. I fealt with lvm and extX before so i understand what you are writing about. I wand just remove fyle system and put there two partitions instead of one which is also should be xfs
1 person found this helpful
If there's no data you need to save, then all you have to do is to re-partition the device and re-initialize the partitions with the filesystem you need.
You can do it with fdisk or parted. Since fdisk is an interactive tool and more complex to explain, I show you parted.
Open a terminal window and logon as root, or type the following into the server console.
Assuming the device name is sdb (your 2nd hard drive), create two partitions 50 % each, for example:
# parted -s /dev/sdb mklabel msdos mkpart primary 1 50%
# parted -s /dev/sdb mkpart primary 50% 100%
# parted -s /dev/sdb print
Number Start End Size Type File system Flags
1 1049kB 4106MB 4105MB primary
2 4106MB 8212MB 4106MB primary
Create the filesystems:
# mkfs.xfs /dev/sdb1
# mkfs.xfs /dev/sdb2
Then mount the filesystems:
# mkdir /home2 /home3
# mount /dev/sdb1 /home2
# mount /dev/sdb2 /home3
# df -h | grep sdb
/dev/sdb1 3.9G 33M 3.8G 1% /home2
/dev/sdb2 3.9G 33M 3.8G 1% /home3