PDA

View Full Version : Move Home directory



BenTrein
5th December 2008, 03:45 AM
I have 2 questions. First the long one:

I did a clean install of F10 (64bit), having had F9 for a while.
In F9 I had the following setup:

sda1 = Windoze XP
sda2 = F9
sda3 = swap
sdb1 = /home
sdb2 = ntfs disk

Not wishing to format sdb1, for there's some data there now that I don't want to lose, during the F10 install, I set sda2 and sda3 to format. I didn't touch or point to sdb1, which was displayed as having /home as mount point.

Now F10 is installed, I have an icon on my desktop saying BenTrein's home, and a mounted disk icon named /home; the latter being a link to sdb1, the former being a new home directory on sda2. Without reinstalling, how can I merge these two; or how can I delete the home directory on sda2 (as it's empty), and direct the BenTrein's home icon to sdb1/home?

And then the short question:
Upon startup, all disks are automatically mounted, including sda1. How can I prevent sda1 from mounting? It has no use while running Fedora...

daverj
5th December 2008, 03:56 AM
If I understand your issue correctly, simply edit /etc/fstab to make /dev/sdb1 the mount point for /home. The file is easy to understand. If you don't understand it by reading it, read the man page:


man fstab


also, remove the sda1 entry from fstab. That will prevent it from mounting on boot.

davidj

BenTrein
5th December 2008, 04:04 AM
If I understand your issue correctly, simply edit /etc/fstab to make /dev/sdb1 the mount point for /home. The file is easy to understand.

Thanks; it seems straightforward enough, and I understand where you're coming from. fstab under F9 was indeed easy to understand, but when I edit it in F10, I get confused. Here's my /etc/fstab:


#
# /etc/fstab
# Created by anaconda on Fri Dec 5 10:02:53 2008
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or vol_id(8) for more info
#
UUID=19eaa4c0-64a7-4fd6-a493-870be38891a9 / ext3 defaults 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
UUID=e3f37894-6ccf-4803-9911-2e313b43da93 swap swap defaults 0 0

Perhaps I need to edit a different file? :confused:

daverj
5th December 2008, 04:44 AM
no, you just need to make a new entry:


/dev/sdb1 /home ext3 defaults 1 2


davidj

BenTrein
5th December 2008, 04:59 AM
And then reboot, I asume. I will, later.

What do I need to change not to auto-mount the sda1 (Windoze disk)?

sidebrnz
5th December 2008, 08:25 AM
Add this line to fstab:

/dev/sda1 /media/Windows ntfs-3g noauto,user,umask=0000 0 0

That will allow you to mount it without being root, but won't auto mount it anymore. One thing that often bites new users: remember to hit Enter at the end of the line if this is the last line in fstab, as mount will complain and ignore the line if you don't.

BenTrein
5th December 2008, 09:41 AM
I'm as of now very very hesitant to edit anything in the F10 fstab. I added daverj's advice, and upon next reboot, I ran into an error that I couldn't bypass. No matter what I tried, it said this was not a valid ext3 drive, and wouldn't load fedora any more; so much for ignoring a line it doesn't understand! ... :s
So I ended up re-installing F10; this time, I assigned the old /home directory as the current home directory. This works, however, now it doesn't automount any drive any more... :s

Gundumfx
5th December 2008, 10:45 AM
try /dev/sdb1 /home ext3 defaults 0 0

BenTrein
6th December 2008, 08:25 AM
Re-install later, I'm extremely hesitant to edit fstab ever again. The fstab in F10 (X64) is a lot harder to understand than the fstab in F9.
The reason I'm so hesitant is that the previous 2 times that I edited fstab I got a fatal crash upon startup, and nothing I knew how to do worked except for a complete clean re-install.

This is my fstab:


#
# /etc/fstab
# Created by anaconda on Fri Dec 5 22:50:45 2008
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or vol_id(8) for more info
#
UUID=2e3b881f-9aa6-4429-84ee-218d6faaa7c8 / ext3 defaults 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
UUID=f0ced6ca-3bf8-475e-a9cb-62cbb3a46ae8 swap swap defaults 0 0

What I want to happen now, is the same as in the first post. I want the "BenTrein's home" icon on the desktop to point to another disk. Now it points to sda2, and I want it to be on sdb2, which is formated as ext3.
Next I want to automount one of the two ntfs formated drives, which is on sdb1, and I now manually mount it on /mnt/data
I don't know the UUID code for those disks.

Could someone please post the whole code that should be in my fstab (so not only 'add this', but also show where to add it). If to do that, you need more information, I'm of course ready to provide it, but I need to know where to look.

papal
6th December 2008, 08:41 AM
You don't need to reboot to test or use edits to fstab. In fact you don't want to because of precisely what happened to you. Just use a mount -a to test (you can also use the device name of course, I just find -a is quick and easy). If it complains, fix it, if it's good well, not only is it now mounted and ready to go, but it'll work on the next reboot (when you have to reboot for legitimate reasons).

stevea
6th December 2008, 10:07 AM
Re-install later, I'm extremely hesitant to edit fstab ever again. The fstab in F10 (X64) is a lot harder to understand than the fstab in F9.
The reason I'm so hesitant is that the previous 2 times that I edited fstab I got a fatal crash upon startup, and nothing I knew how to do worked except for a complete clean re-install.

Daverj gave solid advise. The fstab should look like this:


#
# /etc/fstab
# Created by anaconda on Fri Dec 5 22:50:45 2008
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or vol_id(8) for more info
#
UUID=2e3b881f-9aa6-4429-84ee-218d6faaa7c8 / ext3 defaults 1 1
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
UUID=f0ced6ca-3bf8-475e-a9cb-62cbb3a46ae8 swap swap defaults 0 0
/dev/sdb1 /home ext3 defaults 1 2


Since you had a problem let's try another approach first.

As root try these commands:
mkdir /tmp/mp
mount -t ext3 /dev/sdb1 /tmp/mp
If that works then do "umount /tmp/mp", edit the fstab as above, then try "mount -a" no reboot necessary.

BenTrein
6th December 2008, 01:36 PM
Thanks for that. It worked.

After trying that, I did a reboot though - needed to go shopping according to the wife - and upon startup I suddenly found all sdb disks on my desktop (1 and 2), automounted. So now I have my home directory linked to the sdb disk, and a seperate disk icon linked to the same thing. Any ideas how to get that icon to hide/disappear? But hey, better two icons to the same place than none! :)

Edit: After another reboot, I have another problem... The mounted drives are on the desktop, and the home disk icon is gone; only the home folder icon is there. All fine so far. However, I had a few things saved on the desktop (a folder with pictures I needed to sort out). They are no longer on the desktop; possibly because now a new desktop folder has been assigned. Is there anywhere I can find the old desktop folder and retrieve those pics?