Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing mountpoint from /backup to /home2 1

Status
Not open for further replies.

nerbonne

Technical User
Dec 11, 2006
99
US
Hi all. I would like to change the mount point of /dev/sdb1 from /backup to /home2. I tried just changing it in the fstab file, but the volume didn't mount when I rebooted the system. I already disabled fstab-sync, so that is not it. Maybe there is something I need to change in the mntab as well?

Here is the contents of my fstab:

LABEL=/ / ext3 defaults,usrquota 1 1
LABEL=/backup /backup ext3 defaults 1 2
LABEL=/boot /boot ext3 defaults 1 2
none /dev/pts devpts gid=5,mode=620 0 0
none /dev/shm tmpfs defaults 0 0
LABEL=/home /home ext3 defaults,usrquota 1 2
none /proc proc defaults 0 0
none /sys sysfs defaults 0 0
LABEL=/tmp /tmp ext3 defaults 1 2
LABEL=/usr /usr ext3 defaults,usrquota 1 2
LABEL=/var /var ext3 defaults,usrquota 1 2
LABEL=SWAP-sda8 swap swap defaults 0 0
/dev/hda /media/cdrom auto pamconsole,exec,noauto,managed 0 0
 
I take it that is the contents of fstab without your changes?

There's no need to reboot. umount /backup, tune2fs -L /home2 /dev/sdb1 to change the label on that filesystem to the new mount point name. Modify /etc/fstab and changes both occurrences of /backup to /home2. mkdir /home2 and then mount /home2. rmdir /backup to clean up after yourself.

I suspect that when you tried to do it you missed the part where you change the label on the filesystem... this means that the OS is unable to find the appropriate filesystem to mount on that mount point because it is mounted by label.

Annihilannic.
 
Yes, I didn't know about the tune2fs command. The labeling thing is new to me.

Thank you very much, that worked perfectly.
 
Labelling is handy because if at some point you added a new device to your system which caused the device enumeration order to change, (for e.g. sda became sdb), your system would still be bootable without any changes to /etc/fstab.

Annihilannic.
 
Trying to do this on an unrelated disk throws an error?

kbackup:~ # umount /nbs1
kbackup:~ # tune2fs -L /nbs1 /dev/sda1
tune2fs 1.38 (30-Jun-2005)
tune2fs: Bad magic number in super-block while trying to open /dev/sda1
Couldn't find valid filesystem superblock.

Why does it say that? The disk works fine when mounted?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top