LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to Split disk space and not delete the files (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-split-disk-space-and-not-delete-the-files-917687/)

ytyyutianyun 12-08-2011 02:03 AM

how to Split disk space and not delete the files
 
I have a "/home" and want to cut to two parts "/home1" and "/home2" and
not delete the file.how to do it

Thanks

i.e:

ceshi1@node16:~> df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 149605344 58219344 83786452 41% /
udev 9437184 124 9437060 1% /dev
/dev/sda1 101086 21443 74424 23% /boot
node17:/home 476489632 231970144 220315136 52% /home
node17:/public 480719072 46968832 409331040 11% /public
node17:/users 488292320 450968288 12904832 98% /users
node17:/data2 480719072 200630016 255669856 44% /data2

to

Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda3 149605344 58219344 83786452 41% /
udev 9437184 124 9437060 1% /dev
/dev/sda1 101086 21443 74424 23% /boot
node17:/home1 240000000 231970144 8029856 96% /home1
node17:/home2 244519488 0 244519488 0% /home2
node17:/public 480719072 46968832 409331040 11% /public
node17:/users 488292320 450968288 12904832 98% /users
node17:/data2 480719072 200630016 255669856 44% /data2

corp769 12-08-2011 02:11 AM

Could I ask why you would want to do this? For whatever reason why, there might be a better way.....

acid_kewpie 12-08-2011 03:16 AM

clearly /home is on a remote server, why are you showing us it from there??

ytyyutianyun 12-08-2011 06:54 AM

Quote:

Originally Posted by corp769 (Post 4544909)
Could I ask why you would want to do this? For whatever reason why, there might be a better way.....

Because there are many users using this parallel computer,one is for internal staff and one is for anyone.
So I want to Split disk space and not delete the files only for: the larger for internal staff and the smaller for anyone.
Thanks

ytyyutianyun 12-08-2011 06:57 AM

Quote:

Originally Posted by acid_kewpie (Post 4544943)
clearly /home is on a remote server, why are you showing us it from there??

I want to show how to deal with it, is there any wrong in my statement? Thanks

acid_kewpie 12-08-2011 08:36 AM

you need to "deal with it" on the server.

TobiSGD 12-08-2011 11:40 AM

1. If you repartition the drive you always have to make backups first, partitioning is system critical task that can fail any time. So actually there should be no point in trying this without deleting the files.
2. So your users do use to much space? A better way than repartitioning would be to set up a quota, I would think.

If you really want to do that for whatever reason:
- Unmount the /home-partition.
- Shrink it with the partitioner of your choice to the desired size and create the new partition.
- Adapt /etc/fstab to the new layout. You have to do that on every machine that mounts those partitions.
- Copy over the home directories of the respective users to the new partition.
- Change the setting for the home directory for every user.

Warning: Of course you should try this first on your test server before doing it on a production machine! And even if it works on the test server, backup your production server before doing anything!

ytyyutianyun 12-09-2011 04:06 AM

Quote:

Originally Posted by TobiSGD (Post 4545271)
1. If you repartition the drive you always have to make backups first, partitioning is system critical task that can fail any time. So actually there should be no point in trying this without deleting the files.
2. So your users do use to much space? A better way than repartitioning would be to set up a quota, I would think.

If you really want to do that for whatever reason:
- Unmount the /home-partition.
- Shrink it with the partitioner of your choice to the desired size and create the new partition.
- Adapt /etc/fstab to the new layout. You have to do that on every machine that mounts those partitions.
- Copy over the home directories of the respective users to the new partition.
- Change the setting for the home directory for every user.

Warning: Of course you should try this first on your test server before doing it on a production machine! And even if it works on the test server, backup your production server before doing anything!

A better way than repartitioning would be to set up a quota]
how to do it .Thanks

corp769 12-09-2011 09:07 AM

You could always attempt to go one up and search online ;)

theNbomr 12-09-2011 02:27 PM

Your requirement seems to involve creating two partitions where there previously was only one. Theoretically, this can be accomplished with tools such as parted/gparted. If there is any value to the data, it would be prudent to create a backup before attempting such a maneuver (of course, if the data has value, you've backed it up already, right?). Since the result will be that the two partitions will have new names, the network filesystem shares will also have new names, so the change cannot happen seamlessly, from the perspective of the clients. The client(s) will require accordant changes to mount the new shares.
If it isn't obvious, the change will have to be done on the fileserver. No client alone can perform such changes.
--- rod.

ytyyutianyun 12-10-2011 06:50 AM

Quote:

Originally Posted by corp769 (Post 4545877)
You could always attempt to go one up and search online ;)

I'm sorry, I have thought the Quota means "share" . But Now I know it is a function of linux.
Please forgive for my disunderstanding. Thanks, I know.

ytyyutianyun 12-10-2011 06:55 AM

Quote:

Originally Posted by theNbomr (Post 4546139)
Your requirement seems to involve creating two partitions where there previously was only one. Theoretically, this can be accomplished with tools such as parted/gparted. If there is any value to the data, it would be prudent to create a backup before attempting such a maneuver (of course, if the data has value, you've backed it up already, right?). Since the result will be that the two partitions will have new names, the network filesystem shares will also have new names, so the change cannot happen seamlessly, from the perspective of the clients. The client(s) will require accordant changes to mount the new shares.
If it isn't obvious, the change will have to be done on the fileserver. No client alone can perform such changes.
--- rod.

Thanks, but there are dangers, and may cause popular anger. I think the "Quota" is what I want. Thanks


All times are GMT -5. The time now is 12:50 AM.