LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   trouble mounting main partition (https://www.linuxquestions.org/questions/linux-newbie-8/trouble-mounting-main-partition-811129/)

bluegospel 05-30-2010 03:35 PM

trouble mounting main partition
 
Hi. My /etc/fstab file includes /dev/hda7 (my largest partition) at /home, but when I run df -h, this partition is not listed as an active partition? So is this partition actually mounted?

jamescondron 05-30-2010 03:40 PM

Doesn't look it. Could you give us the output of

Code:

cat /etc/fstab
cat /etc/mtab
df


bluegospel 05-30-2010 04:40 PM

fstab:
/dev/hda5 / ext4 defaults 1 1
/dev/hda2 /windowspartition ntfs-3g umask=022 1 0
/dev/hda7 /home ntfs-3g umask=000 1 0
#/dev/cdrom /mnt/cdrom auto noauto,owner,ro 0 0
/dev/fd0 /mnt/floppy auto noauto,owner 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
proc /proc proc defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0

mtab:
/dev/root / ext4 rw,barrier=1,data=ordered 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
usbfs /proc/bus/usb usbfs rw 0 0
/dev/hda2 /windowspartition fuseblk rw,allow_other,default_permissions,blksize=4096 0 0
tmpfs /dev/shm tmpfs rw 0 0

alunduil 05-30-2010 04:43 PM

What happens if you run `mount -a`? Also, if that doesn't work `mount /dev/had7`?

Regards,

Alunduil

jamescondron 05-30-2010 04:44 PM

Code:

dmesg|grep mount
dmesg|grep ntfs


bluegospel 05-30-2010 04:47 PM

root@bluegospel:~# mount -a
NTFS signature is missing.
Failed to mount '/dev/hda7': Invalid argument
The device '/dev/hda7' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
mount: devpts already mounted or /dev/pts busy
root@bluegospel:~# mount /dev/hda7
NTFS signature is missing.
Failed to mount '/dev/hda7': Invalid argument
The device '/dev/hda7' doesn't seem to have a valid NTFS.
Maybe the wrong device is used? Or the whole disk instead of a
partition (e.g. /dev/sda, not /dev/sda1)? Or the other way around?
root@bluegospel:~#

alunduil 05-30-2010 05:00 PM

Have you done an fsck in windows on that partition lately or did Windows not shutdown cleanly last time? If it's not either of those I would make sure windows can read it before continuing to troubleshoot on the Linux side.

Regards,

Alunduil

jamescondron 05-30-2010 05:00 PM

Has this ever been mounted? Does it mount anywhere else? What does
Code:

lsmod|grep ntfs
give?

bluegospel 05-30-2010 05:06 PM

root@bluegospel:~# dmesg|grep mount
EXT3-fs: hda5: couldn't mount because of unsupported optional features (240).
EXT2-fs: hda5: couldn't mount because of unsupported optional features (240).
EXT4-fs: mounted filesystem hda5 with ordered data mode
GFS2: gfs2 mount does not exist
GFS2: gfs2 mount does not exist
root@bluegospel:~# dmesg|grep ntfs
root@bluegospel:~#

bluegospel 05-30-2010 05:11 PM

root@bluegospel:~# lsmod|grep ntfs
root@bluegospel:~#

jamescondron 05-30-2010 05:21 PM

RedHat?

bluegospel 05-30-2010 05:26 PM

Not RedHat, Slackware.

bluegospel 05-30-2010 05:30 PM

The other day it shutdown abruptly and I don't recall whether it was running Windows or Linux. I usually run Linux on that PC but I'm not sure.

bluegospel 05-30-2010 06:14 PM

You were right Alunduil. I went into Windows and found that this drive had not yet been formatted. I've formatted it in Windows and now I can view it in Linux. Thanks!

bluegospel 05-30-2010 06:22 PM

Okay, now I've mounted that drive to my home directory, but now I cannot run startx as barth because /home/barth is obscured by the partition. chown -R barth /home/barth fails.

jamescondron 05-30-2010 06:27 PM

Directories need to be empty to mount on them; either make this so or set your ntfs partition to mount elsewhere

alunduil 05-30-2010 06:29 PM

So if I understand you correctly, you are trying to use an NTFS partition as your home directory? This seems like it should be possible but you'll need the files from your old home directory.

1. Unmount the NTFS volume.
2. As root mv /home/barth{,.bak}
3. As root again mkdir /home/barth.
4. Chown /home/barth to match /home/barth.bak
5. Remount the NTFS volume.
6. cp -pr /home/barth.bak/* /home/barth.bak/.[^.]* /home/barth

Be careful, if you screw up at some point there is the possibility you can lose your data completely.

Regards,

Alunduil

alunduil 05-30-2010 06:35 PM

Just for informational purposes: directories do _not_ have to be empty to mount a device on them but if you do mount a device on a nonempty directory all files that were in that directory will be *unavailable*. They will not be deleted or removed but they will not be accessible from that mount point anymore.

Just to continue the fun with mounting devices, you can mount one device in several mount points including underneath of itself (why you would do that I don't know). Thus mounting over other mountpoints or directory locations can give a diverse and easy to manipulate runtime experience. Especially, when you couple this idea with pam_mount.so.

Regards,

Alunduil

jamescondron 05-30-2010 06:38 PM

Quite, but it makes a certain amount of sense to assume this ;)

And also be wary of cyclical mountpoints. I lost a hard drive because of these, chroot, rm -rf and idiocy once.

bluegospel 05-30-2010 08:28 PM

mv /home/barth{,.bak}

Could you break this down for me? What's the {,.bak}?

syg00 05-30-2010 09:03 PM

I have a bad feeling about this - NTFS is still proprietary. That means the folks that provide us with Linux support do a fantastic job, but can't guarantee anything. We still don't have a fsck last I looked.
What I would suggest (and do) is to keep /home as a Linux f/s, and use NTFS for a common data partition to share stuff. Just mount that somewhere convenient.
That way if something happens to the NTFS you can still login and play (on Linux). And yes I do (also) keep a root user handy ...

alunduil 05-30-2010 10:55 PM

The {,.bak} is a BASH argument vector (shorthand) that means /home/barth /home/barth.bak. Just easier than writing out the entire path twice.

I agree with syg00's concerns but if that's how you want to setup your machine I'm more than willing to tell you how to do it with a big fat warning label of CAUTION. I think if you're using ntfs-3g you'll be fine as I've never heard (although I don't really listen to anything Windowsish) of NTFS being a problem FS with it.

Regards,

Alunduil

bluegospel 05-31-2010 03:22 PM

Okay, I'm running slackware. I followed the six steps suggested. Now I've got a folder in my /home directory highlighted in green as follows:

System\ Volume\ Information

owned by root.

In my /home directory in X (as root) I've got the folder, "System Volume Information" containing "MountPointManagerRemoteDatabase" and ""tracking.log".

When I run chown -R barth /home/barth I "cannot access /home/barth" (no such file or directory). I've already run userdel, useradd and passwd for the user barth.

Data loss isn't a concern since I'm really just experimenting with Linux for now. I anticipate reinstalling slackware several more times before I'm comfortable with it. But to save time, is there an easy way to reset my home directory to an empty directory that still serves as my de facto "home directory."

alunduil 05-31-2010 03:33 PM

Just copy and modify the permissions of /etc/skel. That's an empty home directory template.

Regards,

Alunduil

bluegospel 05-31-2010 03:36 PM

Cool, thanks!

bluegospel 05-31-2010 03:43 PM

Would that just be "cp /etc/skel /home" or do I need certain options?

alunduil 05-31-2010 07:25 PM

You would need -r for recursion but other than that you should be fine.

Regards,

Alunduil


All times are GMT -5. The time now is 02:31 AM.