Revising mount point label
Paul Iadonisi
pri.blu at iadonisi.to
Sun Jan 13 21:16:20 EST 2002
On Sun, Jan 13, 2002 at 06:27:59PM -0500, jbk wrote:
> I have just installed RH7.2 on its own box. No
> more dual booting. Anyway I created two ext3
> partitions, one labeled '/' and the other '/home',
> and now I have decided that I would like to move
> '/home' to '/' and label/mount hda3 as 'data'. I
> believe I can do this without repartitioning. I
Yes, you can.
> will do this when booted to linux single so that
> '/' is the only mounted partition. Do I use mke2fs
> or its equivalent to remame the partition? Will
No *need* to reformat with mke2fs, but it is the
quickest way, especially if you have a lot of existing
data in /home.
> the '/home' directory be recreated on reboot? I am
No, mount points are not created automatically.
> not concerned about loosing any custimizations.
> Should I mv '/home' to '/newhome' and then relabel
> hda3. I assume that I will have to maually make a
> new entry for '/data' in 'fstab' since it is not a
> standard directory name.
Here's my suggested approach:
# umount /home # if it's mounted, that is
# mkdir /oldhome
# mount -r -t ext3 /dev/hda3 /oldhome
# cd /home
# tar cf - -C /oldhome . | tar xfp -
# rm -rf lost+found # Optional -- lost+found makes no sense in simple
# # directories, it's only for separate filesystems
# umount /oldhome
# rmdir /oldhome
# mkdir /data
# vi /etc/fstab # here you would change all occurences of 'home' to 'data'
# e2label /dev/hda3 /data
# mount /data
At this point, you can clear out any existing data in /data with a careful
set of 'rm -rf' commands. Alternatively, instead of the last two commands
above, you could just do this:
# mke2fs -j /dev/hda3
# mount /data
--
-Paul Iadonisi
Senior Systems Administrator
Red Hat Certified Engineer / Local Linux Lobbyist
Ever see a penguin fly? -- Try Linux.
GPL all the way: Sell services, don't lease secrets
More information about the Discuss
mailing list