LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   re-mounting partition (https://www.linuxquestions.org/questions/linux-desktop-74/re-mounting-partition-570134/)

Slipstream2006 07-17-2007 12:28 PM

re-mounting partition
 
Hello,

I just copied all my information from dev/md7/home to a second partition named dev/md6/archive. I'd like to re-mount dev/md6/archive as dev/md6/home. Hence, it will become my new /home directory.

The original /home partition will be erased and mount point /archive will no longer exist.

I've been reading the man documentation, but I'm afraid I might not be smart enough to understand it. Can someone tell me how to do it? I know it goes something like...

$mount -t type device dir

but I don't really know what that means. Anyone? Thanks in advance!

manlydan 07-17-2007 12:40 PM

Quote:

Originally Posted by Slipstream2006
$mount -t type device dir

-t type is the filesystem type of the device you are mounting.

device is the device node you want to mount. From what I understand, you want to mount the /dev/md6 device node.

dir is the directory you want to use as your mount point, which means you use that directory to access the device you have mounted. In your case it would be /home.

So an example would be 'mount -t ext3 /dev/md6 /home'
You would have to replace ext3 with whatever filesystem you are using.

Hope this helps.

MensaWater 07-17-2007 12:46 PM

mount = command

-t type = Filesystem type (not usually necessary if your default is ext3 and that is the type you are using).

device = /dev/md7 or /dev/md6 (these are metadisks)

dir = /home or /arhcive

So assuming ext3 commands you would want to execute:
umount /home
umount /archive
mount -t ext3 /dev/md6 /home
(Note: You of course want to unmount [umount] what is already mounted otherwise it would mount /dev/md6 on TOP of /dev/md7).

Don't forget to modify your /etc/fstab file so they mount correctly after a reboot. Find the entry for md6 and change it so that it mounts as /home rather than /archive then comment out (put a # at the beginning of) the line that contains md7. By the way - if an entry is in /etc/fstab you only have to type "mount /home" because it will get device and type from the associated entries on the same line in fstab.

Slipstream2006 07-18-2007 07:24 AM

Thanks, I'm glad you both understood, despite my confusing explanation. Your replies are exactly what I was looking for. However, the command

umount /archive

returns 'not found.' I've checked the file system, and everything seems right. Also, if I enter

vi /etc/fstab

from the command prompt, the fstab file doesn't display any of the relevant mount points or devices. But, it shows them if I start the system normally and view fstab with Konqueror. Should the vi editor display the same thing?

MensaWater 07-18-2007 07:43 AM

I would have thought so but I don't use the the GUI for filesystem stuff so its possible it has its own config file for mounts (which would suck IMO).

Please provide output for each of the following command lines:

uname -a

cat /etc/issue

df -h

mount

cat /etc/fstab

manlydan 07-18-2007 07:52 AM

Quote:

Originally Posted by Slipstream2006
umount /archive

returns 'not found.'

This happens when the directory /archive doesn't exist.
If the directory does exist but doesn't have anything mounted to it, it should return 'not mounted'. But if you didn't want anything mounted there anyway, then I wouldn't think this will cause you any problems.

Quote:

Also, if I enter

vi /etc/fstab

from the command prompt, the fstab file doesn't display any of the relevant mount points or devices. But, it shows them if I start the system normally and view fstab with Konqueror. Should the vi editor display the same thing?
This seems strange to me. Open it using vi and if the mount points you need aren't set up then go ahead and do as jlightner suggested.

MensaWater 07-18-2007 08:10 AM

Right - I asked for the output because his original post seemed a little off to me and the results he got make me think either he's misstating his configuration or we're misunderstanding it.

Getting the command outputs will help us understand what he really has.

Slipstream2006 07-18-2007 08:58 AM

Ok, I can provide the outputs, but before I do... Just so you know, I'm using the prompt from the Rescue System (installation disk1). Does that make a difference.

Rescue login: root
Rescue:~ #

manlydan 07-18-2007 09:12 AM

The output will only be useful when used while you're logged into your actual system. As it is, you will only be giving us the information relative to the rescue CD.

Since you are using a rescue CD, are you having problems logging into your system?

Slipstream2006 07-18-2007 10:01 AM

Ok, I see what you mean now, manlydan. I suspect that using the Rescue CD might be the cause of my problems. I was using the Rescue CD to umount/mount the partitions. Maybe that was wrong. What should I use for this task? I can't umount/mount these partitions from a terminal on running system, can I?

I'm not hooked up to the Internet on that machine, so I can't easily copy the output. But...

vi /etc/fstab---looks good now, the way it's supposed to be.
/dev/md6_________/archive__________ext3________defaults________1_2


uname -a
2.6.18.2-34-default .........

cat /etc/issue
Welcome to openSuSE 10.2 (x86_64) - Kernel \r (\1)

df -h
Similar to /etc/fstab above. All devices and mount points are correct.

mount
Again, similar to /etc/fstab above. All devices and mount points are correct.

cat /etc/fstab
Again, again, similar to /etc/fstab above. All devices and mount points are correct.



It looks like I shouldn't have used the Recovery CD for the mounting tasks. For some reason it escapes me how to get to the right command prompt for this. Suggestions please!

manlydan 07-18-2007 10:16 AM

Quote:

Originally Posted by Slipstream2006
I can't umount/mount these partitions from a terminal on running system, can I?

You can mount/unmount anything you want from your running system (just don't try to unmount the root directory: /) ;)

Slipstream2006 07-19-2007 08:25 AM

I figured that if I alter a running system, then it wouldn't work. That's why I kept thinking I need the Rescue CD. Thanks for setting me straight on that.

Unfortunately though, it seems I've done something wrong. I unmounted /archive and mounted /home in its place using the terminal. Then I changed /etc/fstab using Konqueror.

Now I get the message upon startup: Could not start kstartupconfig. Check your installation.

I originally tried changing it using the vi editor, but I couldn't manipulate it correctly. Maybe that's where it went awry. Hmmmmm. I'm worried.

manlydan 07-19-2007 08:39 AM

A quick search brought this up:

http://forums.suselinuxsupport.de/in...howtopic=31577

It seems your username is not recognized as having a home directory. To fix this:

1) mount your /home partition
2) do this command inserting your username:
chown username.username -R /home/username

See if that works.

Slipstream2006 07-19-2007 05:23 PM

Thanks, I initially saw that link too. But I didn't want to mess things up even more, so I didn't try the command.

Now I tried it, but it didn't fix the problem. "invalid user" was the output. Looks like I need to start from the beginning and create a user. Haven't quite figured it out yet...

Slipstream2006 07-19-2007 06:31 PM

Ok, got the user created with new password. But the command

Code:

chown username.username -R /home/username
still produces "invalid user." And I still get message

Quote:

Could not start kstartupconfig. Check your installation.
when trying to log on. I need a hammer! :mad: :tisk: :newbie:


All times are GMT -5. The time now is 12:08 PM.