Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
After installing SuSE 9.1 SP2 Ent. Server, I decided that /var, /usr, /home and /opt would be better suited on logical volumes. The problem is that the server is already built, and the above directories already exist at /.
Here is what I am thinking:
1) My volume group already exists --> Dell01
2) create logical volume
lvcreate -L 2G -n lvol4 /dev/Dell01
3) make filesystem
mkfs -t reiserfs /dev/Dell01/lvol4
4) modify fstab with the following entry:
/dev/Dell01/lvol4 /varNEW reiserfs acl,user_xattr 1 2
5) create mount point
6) mount varNEW
7) copy -R /var /varNEW
Okay. Now I've got the data copied to /varNEW. How do I rename /varNEW to /var? I'm stumped.
First, I would name your volume group starting with the text "vg" to make it obvious what it is, for easy identification when you're scanning through the large /dev directory. Second, I would name the individual logical volumes in some way that indicates there eventual mountpoints. "there", "their", "they're" ... ahhh, who cares! ;-)[/edit] These are my personal preferences only, you may want to do things differently. The final "telinit 2" in my example below should be replaced with whatever your default multiuser runlevel is. On my Debian system it's 2, your SuSE system may be different.
Thanks for the info, Haertig! Everything worked pretty well until I issued the mount command:
mount -t resierfs /dev/vg_Dell01/suse_var /var
The directory (mount point) /var did not exist. I then created the mount point:
I then edited /etc/fstab with the appropriate entry. I then rebooted. This is when the problem occurred. The boot log said that it couldn't write to /var/.. whatever. The problem was that var was in the directory var --> /var/var
I was able to fix this but am not sure how /var.old was copied to /var/var. hmmmm. Anyway, you got me on my way. Thanks alot.
Oops. I forgot to put in an example command to create the new mountpoint. Drats! Obviously you have the smarts to figure this out, as you so quickly noticed and correct my omission. Sorry about that.
I was able to fix this but am not sure how /var.old was copied to /var/var.
Yeah, who knows. Probably just some typo somewhere on the commandline. Better clean it all up now though, because when you come back to /var in six months you'll be scratching your head ... "What the heck is /var.old and /var/var???!!!"
One other thing I learned (from experience) about naming volume groups, generic names are not so good always. I had two volume groups on my system, named "vg0" and "vg1". There are probably tons of systems out there with these exact volume group names. Then I plugged in another harddisk that coincidently happened to have a volume group on it also named "vg0". Well, I can't tell you who was more confused on initial boot after this new harddisk was added - me or the OS. That first boot attempt was good for learning and troubleshooting, but not much else!