LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-08-2011, 02:03 AM   #1
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Rep: Reputation: Disabled
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

Last edited by ytyyutianyun; 12-08-2011 at 02:08 AM.
 
Old 12-08-2011, 02:11 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
Could I ask why you would want to do this? For whatever reason why, there might be a better way.....
 
Old 12-08-2011, 03:16 AM   #3
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
clearly /home is on a remote server, why are you showing us it from there??
 
Old 12-08-2011, 06:54 AM   #4
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by corp769 View Post
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
 
Old 12-08-2011, 06:57 AM   #5
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by acid_kewpie View Post
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
 
Old 12-08-2011, 08:36 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
you need to "deal with it" on the server.
 
1 members found this post helpful.
Old 12-08-2011, 11:40 AM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
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!
 
1 members found this post helpful.
Old 12-09-2011, 04:06 AM   #8
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TobiSGD View Post
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
 
Old 12-09-2011, 09:07 AM   #9
corp769
LQ Guru
 
Registered: Apr 2005
Posts: 5,817

Rep: Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002Reputation: 1002
You could always attempt to go one up and search online
 
Old 12-09-2011, 02:27 PM   #10
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
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.
 
Old 12-10-2011, 06:50 AM   #11
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by corp769 View Post
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.
 
Old 12-10-2011, 06:55 AM   #12
ytyyutianyun
Member
 
Registered: Nov 2011
Posts: 63

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by theNbomr View Post
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
zero disk space left even if i delete files wakkana12 Slackware 13 09-07-2010 09:56 AM
Disk Space shows more used disk thank size of files present in folder vinvar Linux - Virtualization and Cloud 2 11-02-2009 11:59 PM
What to Delete to Clear Disk Space? PatrickW Linux - Newbie 5 05-03-2008 01:59 PM
Which folder in linux can be safetly delete to save disk space. TruongAn Linux - General 8 12-19-2005 02:09 PM


All times are GMT -5. The time now is 07:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration