Operating System - HP-UX
1835266 Members
2403 Online
110078 Solutions
New Discussion

Re: Renaming a filesystem

 
SOLVED
Go to solution
Paul Wright
Advisor

Renaming a filesystem

Rookie question. I have to reduce the size of a lv to free up wasted space and I want to go with one of the suggestions I read here....BUT....how do I rename a filesystem?. I have created a new one (b), transfered the info from the old one(a) to (b), then I want to delete (a) and rename (b). I hope this makes sense to someone out there.

Thanks in advance for any help
Paul
7 REPLIES 7
Christopher McCray_1
Honored Contributor
Solution

Re: Renaming a filesystem

Hello,

I would unmount the filesystem , change the name of the directory, and change the name of the mountpoint directory in /etc/fstab and then mount /filesystem.

Hope this helps
Chris
It wasn't me!!!!
Sandip Ghosh
Honored Contributor

Re: Renaming a filesystem

I would do as follows:

Mount (b) on /tmp/abcd
cp * from (a) (b)
unmount (b)
unmount (a)
vi /etc/fstab for doing the required change for lvname
then
mount -a

Hope this helps,

Sandip
Good Luck!!!
Pascal Rouchon
Advisor

Re: Renaming a filesystem

Yes you just have to umount the two filesystem then replace (a) by (b) in /etc/fstab then remount (b) filesysyem then delete the logical volume for (a)

nancy rippey
Trusted Contributor

Re: Renaming a filesystem

You don't have to rename the filesystem if you don't want. The procedures I use to solve this type of problem is

Say fsa is the original fs and
fsb is the new one with the correct size.

Create fsb with the correct size

copy over the data from fsa to fsb

unmount fsa

edit /etc/fstab

You should just need to change the lv# for fsa to the lv# you created for fsb.

Mount fsa backup up.

Hope this makes sense

nancy
nrip
Patrick Wallek
Honored Contributor

Re: Renaming a filesystem

An example:

You have /dev/vg01/lvol1 mounted as /test. You configure /dev/vg01/lvol2 and you want that to be your new /test area with all data from /test. How do you do it?

1) mkdir /new_test
2) mount /dev/vg01/lvol2 /new_test
3) cp -Rp /test/* /new_test
4) umount /new_test
5) umount /test
6) mount /dev/vg01/lvol2 /test
(/dev/vg01/lvol2 just became your new /test area)
7) vi /etc/fstab
(change the line '/dev/vg01/lvol1 /test .....' so that it is now '/dev/vg01/lvol2 /test ....' so that the correct LV mounts as /test when the machine reboots.)
8) lvremove /dev/vg01/lvol1
(If you want to now get rid of it, that is)


Hope this helps!
Christopher McCray_1
Honored Contributor

Re: Renaming a filesystem

Hello again,

Doing some cleanup here.

# remove the old logical volume, using lvremove or sam.

# remove the entry for (a) from /etc/fstab.
then proceed as above.

Sorry if I caused any confusion.

Chris
It wasn't me!!!!
Paul Wright
Advisor

Re: Renaming a filesystem

Thanks to all. I'll say one thing, the response time here is phenomenal. Appreciate all the help.

Paul