PDA

View Full Version : how can i change /var partition to /home??



cepal
10-20-2010, 12:17 AM
how can i change /var partition to /home??

Cabalo
10-20-2010, 12:52 AM
GpartED ?

Expeto
10-20-2010, 02:25 PM
What is the point? Why the hell do you want your var part to be your home part? Don't fuck with your Linux Filesystem Hierarchy.

Thinks will get ugly! Specially opposite partitions like /home(a place to make your files permanent) and the /var (a place for VARiable data ).

BTW, /var /proc /boot /dev /etc are usually not partitions, they are usually just folders of the root(/) partition. /home could be linked to a partition in some cases

Also, making your home your var will fuck the system for other users, because they won't be able to connect the /var. Because your /var will be your home, and your home is protected against other users, so their software won't be able to store variable info like locks and other stuff. [notice the difference between home (/home/yourusername/ or ~/ ) and /home, they are very different things!] Do a chmod -R 777 to work around this problem, but this is a very insecure.

if you still want to do it;

#ln -s /var /home

than
#ls -l
to check it.


This makes a symbolic link to connect them. Symbolic links are really confusing things to play with.
RTFMan-page (man ln) for more info.

If you have another question, add the output of fdisk -l and uname -a to you post.

#An example;


[Expeto@localhost ~]$ mkdir exmpleFST
[Expeto@localhost ~]$ cd exmpleFST/
[Expeto@localhost exmpleFST]$ ls
[Expeto@localhost exmpleFST]$ #nothin here
[Expeto@localhost exmpleFST]$ mkdir home
[Expeto@localhost exmpleFST]$ ls
home
[Expeto@localhost exmpleFST]$ cd home
[Expeto@localhost home]$ touch afile_in_folder_one
[Expeto@localhost home]$ touch dont_fuck_with_your_file_system
[Expeto@localhost home]$ ls
afile_in_folder_one dont_fuck_with_your_file_system
[Expeto@localhost home]$ # there is new two files here
[Expeto@localhost home]$ cd ..
[Expeto@localhost exmpleFST]$ ls
home
[Expeto@localhost exmpleFST]$ ln -s home/ var
[Expeto@localhost exmpleFST]$ ls
home var
[Expeto@localhost exmpleFST]$ cd var
[Expeto@localhost var]$ ls
afile_in_folder_one dont_fuck_with_your_file_system
[Expeto@localhost var]$ #link complete
[Expeto@localhost var]$ cd ..
[Expeto@localhost exmpleFST]$ ls home/
afile_in_folder_one dont_fuck_with_your_file_system
[Expeto@localhost exmpleFST]$ ls var/
afile_in_folder_one dont_fuck_with_your_file_system
[Expeto@localhost exmpleFST]$ ls home/
afile_in_folder_one dont_fuck_with_your_file_system
[Expeto@localhost exmpleFST]$ ls var/
afile_in_folder_one dont_fuck_with_your_file_system
[Expeto@localhost exmpleFST]$ cd ..
[Expeto@localhost ~]$ rm -rf exmpleFST/


things start with # are comments, they have no effect on anything

lightshow
12-12-2010, 09:09 PM
Maybe he has /home on a volume group that does not have enough free space. Let's say he has videos in his /home and his volume group only has 5 GB free on it.

Then his /var is on another volume group that has more space in it. Well in that case, he can use pvmove to move data off some partitions in the larger volume group. Then he can vgreduce the larger volume group by that disk he pv'moved

Then he can extend the other volume group that /home is on with vgextend the name of the disk partition you pvmoved earlier.

Then he can lvextend lv_home to be bigger!