PDA

View Full Version : Can't Mount Partitions (Even after re-installing HAL)



Israel
03-06-2007, 07:12 AM
Ok, I did some reading up on this one first. I saw most people with this same problem after installing Knoppix to the hard-drive merely re-installed HAL (Hardware Abstraction Layer) and BOOM. Their problem was solved. But I still cannot mount my Windoze partition? Here is the error I'm getting when I try to mount:

Could not mount device.
The reported error was:
Error opening partition device: Permission denied
Failed to startup volume: Permission denied
Failed to mount '/dev/hda1': Permission denied

JohnnyH
03-06-2007, 10:17 AM
If you would like to post the contents of your /etc/fstab file we might see a clue. :)

Israel
03-06-2007, 08:56 PM
Here is the information you requested....

# /etc/fstab: filesystem table.
#
# filesystem mountpoint type options dump pass
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1

proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbfs /proc/bus/usb usbfs devmode=0666 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/cdrom /media/cdrom iso9660 defaults,ro,users,noexec,noauto 0 0
/dev/cdrom1 /media/cdrom1 iso9660 defaults,ro,users,noexec,noauto 0 0
/dev/dvd /media/dvd iso9660 defaults,ro,users,noexec,noauto 0 0
# Added by KNOPPIX
/dev/hda1 /media/hda1 ntfs noauto,users,exec,umask=000,uid=knoppix,gid=knoppi x 0 0
# Added by KNOPPIX
/dev/hda3 none swap defaults 0 0
# Added by KNOPPIX
/dev/hdc /media/hdc auto ro,noauto,users,exec 0 0
# Added by KNOPPIX
/dev/sda1 /media/sda1 vfat noauto,users,exec,umask=000,shortname=winnt,uid=kn oppix,gid=knoppix 0 0

JohnnyH
03-06-2007, 10:43 PM
Here is the information you requested....

# /etc/fstab: filesystem table.
...
/dev/hda1 /media/hda1 ntfs noauto,users,exec,umask=000,uid=knoppix,gid=knoppi x 0 0
...
/dev/sda1 /media/sda1 vfat noauto,users,exec,umask=000,shortname=winnt,uid=kn oppix,gid=knoppix 0 0

The ",uid=knoppix,gid=knoppix" is your problem (assuming that you did not re-use "knoppix" for your HD-installed User Name).
You need to remove those strings from your fstab thus:

# /etc/fstab: filesystem table.
...
/dev/hda1 /media/hda1 ntfs noauto,users,exec,umask=000 0 0
...
/dev/sda1 /media/sda1 vfat noauto,users,exec,umask=000,shortname=winnt 0 0

AND modify your /usr/sbin/rebuildfstab file as shown here http://www.knoppix.net/forum/viewtopic.php?t=26759
to YOUR user name, otherwise it will just get reset back to knoppix user next time the system runs rebuildfstab !
Good luck :)

Israel
03-07-2007, 04:03 AM
Wow, I tried all of that and I still can't mount hda1? Here's my /usr/sbin/rebuildfstab

#!/bin/bash
# (C) Klaus Knopper Nov 2002
# Calls scanpartitions as root and adds entries to /etc/fstab

PATH="/bin:/sbin:/usr/bin:/usr/sbin"
export PATH
umask 022

[ ! -e /proc/partitions ] && { echo "$0: /proc not mounted, exiting" >&2; exit 1; }

if [ -e /var/run/rebuildfstab.pid ]; then
test -d /proc/"$(</var/run/rebuildfstab.pid)" >/dev/null 2>&1 && exit 0
rm -f /var/run/rebuildfstab.pid
fi

echo "$$" >/var/run/rebuildfstab.pid

# Give usb-storage some more time to detect partitions...
sleep 5

XSH=""
[ -n "$DISPLAY" ] && XSH="rxvt -bg black -fg green -cr red -T $0 -e"

[ "`id -u`" != "0" ] && { exec $XSH sudo $0 "$@"; }


TMP="/tmp/fstab.$$.tmp"
ADDEDBYKNOPPIX="# Added by KNOPPIX"

# Simple shell grep, searches for lines STARTING with string
stringinfile(){
while read line; do
case "$line" in $1*) return 0;; esac
done <"$2"
return 1
}

removeentries(){
# Remove comment line $1 and the following line from file $2
# sed '/^# Added by KNOPPIX/{N;d;}'
while read line; do
case "$line" in $1) read line; continue ;; esac
echo "$line"
done <"$2"
}

verbose=""
remove=""
mkicons=""
user=""
group=""
arg="$1"
while [ -n "$arg" ]; do
case "$arg" in
-v*) verbose="yes" ;;
-r*) remove="yes" ;;
-i*) mkicons="yes" ;;
-u*) shift; user="$1" ;;
-g*) shift; group="$1" ;;
*) echo "Usage: $0 [-v[erbose]] [-r[emove_old]] [-i[cons]] [-u[ser] uid] [ -g[roup] gid]" ;;
esac
shift
arg="$1"
done

[ -n "$verbose" ] && echo "Scanning for new harddisks/partitions..." >&2
rm -f "$TMP"

if [ -n "$remove" ]; then
removeentries "$ADDEDBYKNOPPIX" /etc/fstab >"$TMP"
else
cat /etc/fstab >"$TMP"
fi

count=0
while read device mountpoint fstype relax; do
stringinfile "$device " "$TMP" || \
{ count="$((count + 1))"
if [ -n "$mountpoint" -a "$mountpoint" != "none" -a ! -d "$mountpoint" ]; then
mkdir -p "$mountpoint" 2>/dev/null
compat="/mnt/${mountpoint##*/}"
[ -e "$compat" ] || ln -sf "$mountpoint" "$compat" 2>/dev/null
fi
options="noauto,users,exec"
case "$fstype" in
vfat) options="${options},umask=000,shortname=winnt" ;;
msdos) options="${options},umask=000" ;;
swap) options="defaults" ;;
ntfs*) options="${options},umask=000";;
esac
case "$fstype" in
ntfs*|vfat|msdos)
[ -n "$user" ] && options="$options,uid=$Israel"
[ -n "$group" ] && options="$options,gid=$Israel"
;;
esac
echo "$ADDEDBYKNOPPIX"
echo "$device $mountpoint $fstype $options 0 0"; }
done >>"$TMP" <<EOT
$(scanpartitions)
EOT

# Add CD/DVD-Roms
cdcount=0
while read drive name drives; do
case "$drive$name" in drivename:)
for d in $drives; do
mountpoint="/media/$d"
if [ -n "$mountpoint" -a "$mountpoint" != "none" -a ! -d "$mountpoint" ]; then
mkdir -p "$mountpoint" 2>/dev/null
compat="/mnt/${mountpoint##*/}"
[ -e "$compat" ] || ln -sf "$mountpoint" "$compat" 2>/dev/null
fi
stringinfile "/dev/$d " "$TMP" || \
{ cdcount="$((cdcount + 1))"
echo "$ADDEDBYKNOPPIX"
echo "/dev/$d $mountpoint auto ro,noauto,users,exec 0 0"; }
done
break
;;
esac
done >>"$TMP" <<EOT
$(cat /proc/sys/dev/cdrom/info 2>/dev/null)
EOT

[ -n "$verbose" ] && { [ "$count" -gt 0 -o "$cdcount" -gt 0 ] && echo "Adding $count new partitions and $cdcount new cdrom-type devices to /etc/fstab." >&2 || echo "No new partitions found." >&2; }
mv -f "$TMP" /etc/fstab

[ -n "$mkicons" ] && mkdesktophdicons >/dev/null 2>&1

rm -f /var/run/rebuildfstab.pid

[ -n "$DISPLAY" ] && sleep 2

exit 0

And here's /etc/fstab:

# /etc/fstab: filesystem table.
#
# filesystem mountpoint type options dump pass
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1

proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbfs /proc/bus/usb usbfs devmode=0666 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/cdrom /media/cdrom iso9660 defaults,ro,users,noexec,noauto 0 0
/dev/cdrom1 /media/cdrom1 iso9660 defaults,ro,users,noexec,noauto 0 0
/dev/dvd /media/dvd iso9660 defaults,ro,users,noexec,noauto 0 0
# Added by KNOPPIX
/dev/hda1 /media/hda1 ntfs noauto,users,exec,umask=000, 0 0
# Added by KNOPPIX
/dev/hda3 none swap defaults 0 0
# Added by KNOPPIX
/dev/hdc /media/hdc auto ro,noauto,users,exec 0 0
# Added by KNOPPIX
/dev/sda1 /media/sda1 vfat noauto,users,exec,umask=000,shortname=winnt, 0 0

JohnnyH
03-07-2007, 09:43 AM
In rebuildfstab, you don't want the $ in front of Israel, as you are now using the explicit string and not a string parameter label. So your lines should read:

[ -n "$user" ] && options="$options,uid=Israel"
[ -n "$group" ] && options="$options,gid=Israel"

[Edited 09:07hrs GMT]:-
In /etc/fstab you still(or again) have the commas which are now trailing the end of umask=000 in

/dev/hda1 /media/hda1 ntfs noauto,users,exec,umask=000, 0 0
and at the end of shortname=winnt in

/dev/sda1 /media/sda1 vfat noauto,users,exec,umask=000,shortname=winnt, 0 0

(They may have got back in there as a consequence of the rebuildfstab failing on uid=$Israel and gid=$Israel)

Edit the above and see how that works - good luck :)

Israel
03-07-2007, 04:32 PM
Hmmm... I tried that, didn't work for me? Re-booted, still couldn't get it to work? Here they are again:

# /etc/fstab: filesystem table.
#
# filesystem mountpoint type options dump pass
/dev/hda2 / ext3 defaults,errors=remount-ro 0 1

proc /proc proc defaults 0 0
/dev/fd0 /floppy vfat defaults,user,noauto,showexec,umask=022 0 0
usbfs /proc/bus/usb usbfs devmode=0666 0 0
sysfs /sys sysfs defaults 0 0
tmpfs /dev/shm tmpfs defaults 0 0
/dev/cdrom /media/cdrom iso9660 defaults,ro,users,noexec,noauto 0 0
/dev/cdrom1 /media/cdrom1 iso9660 defaults,ro,users,noexec,noauto 0 0
/dev/dvd /media/dvd iso9660 defaults,ro,users,noexec,noauto 0 0
# Added by KNOPPIX
/dev/hda1 /media/hda1 ntfs noauto,users,exec,umask=000 0 0
# Added by KNOPPIX
/dev/hda3 none swap defaults 0 0
# Added by KNOPPIX
/dev/hdc /media/hdc auto ro,noauto,users,exec 0 0
# Added by KNOPPIX
/dev/sda1 /media/sda1 vfat noauto,users,exec,umask=000,shortname=winnt 0 0


#!/bin/bash
# (C) Klaus Knopper Nov 2002
# Calls scanpartitions as root and adds entries to /etc/fstab

PATH="/bin:/sbin:/usr/bin:/usr/sbin"
export PATH
umask 022

[ ! -e /proc/partitions ] && { echo "$0: /proc not mounted, exiting" >&2; exit 1; }

if [ -e /var/run/rebuildfstab.pid ]; then
test -d /proc/"$(</var/run/rebuildfstab.pid)" >/dev/null 2>&1 && exit 0
rm -f /var/run/rebuildfstab.pid
fi

echo "$$" >/var/run/rebuildfstab.pid

# Give usb-storage some more time to detect partitions...
sleep 5

XSH=""
[ -n "$DISPLAY" ] && XSH="rxvt -bg black -fg green -cr red -T $0 -e"

[ "`id -u`" != "0" ] && { exec $XSH sudo $0 "$@"; }


TMP="/tmp/fstab.$$.tmp"
ADDEDBYKNOPPIX="# Added by KNOPPIX"

# Simple shell grep, searches for lines STARTING with string
stringinfile(){
while read line; do
case "$line" in $1*) return 0;; esac
done <"$2"
return 1
}

removeentries(){
# Remove comment line $1 and the following line from file $2
# sed '/^# Added by KNOPPIX/{N;d;}'
while read line; do
case "$line" in $1) read line; continue ;; esac
echo "$line"
done <"$2"
}

verbose=""
remove=""
mkicons=""
user=""
group=""
arg="$1"
while [ -n "$arg" ]; do
case "$arg" in
-v*) verbose="yes" ;;
-r*) remove="yes" ;;
-i*) mkicons="yes" ;;
-u*) shift; user="$1" ;;
-g*) shift; group="$1" ;;
*) echo "Usage: $0 [-v[erbose]] [-r[emove_old]] [-i[cons]] [-u[ser] uid] [ -g[roup] gid]" ;;
esac
shift
arg="$1"
done

[ -n "$verbose" ] && echo "Scanning for new harddisks/partitions..." >&2
rm -f "$TMP"

if [ -n "$remove" ]; then
removeentries "$ADDEDBYKNOPPIX" /etc/fstab >"$TMP"
else
cat /etc/fstab >"$TMP"
fi

count=0
while read device mountpoint fstype relax; do
stringinfile "$device " "$TMP" || \
{ count="$((count + 1))"
if [ -n "$mountpoint" -a "$mountpoint" != "none" -a ! -d "$mountpoint" ]; then
mkdir -p "$mountpoint" 2>/dev/null
compat="/mnt/${mountpoint##*/}"
[ -e "$compat" ] || ln -sf "$mountpoint" "$compat" 2>/dev/null
fi
options="noauto,users,exec"
case "$fstype" in
vfat) options="${options},umask=000,shortname=winnt" ;;
msdos) options="${options},umask=000" ;;
swap) options="defaults" ;;
ntfs*) options="${options},umask=000";;
esac
case "$fstype" in
ntfs*|vfat|msdos)
[ -n "$user" ] && options="$options,uid=Israel"
[ -n "$group" ] && options="$options,gid=Israel"
;;
esac
echo "$ADDEDBYKNOPPIX"
echo "$device $mountpoint $fstype $options 0 0"; }
done >>"$TMP" <<EOT
$(scanpartitions)
EOT

# Add CD/DVD-Roms
cdcount=0
while read drive name drives; do
case "$drive$name" in drivename:)
for d in $drives; do
mountpoint="/media/$d"
if [ -n "$mountpoint" -a "$mountpoint" != "none" -a ! -d "$mountpoint" ]; then
mkdir -p "$mountpoint" 2>/dev/null
compat="/mnt/${mountpoint##*/}"
[ -e "$compat" ] || ln -sf "$mountpoint" "$compat" 2>/dev/null
fi
stringinfile "/dev/$d " "$TMP" || \
{ cdcount="$((cdcount + 1))"
echo "$ADDEDBYKNOPPIX"
echo "/dev/$d $mountpoint auto ro,noauto,users,exec 0 0"; }
done
break
;;
esac
done >>"$TMP" <<EOT
$(cat /proc/sys/dev/cdrom/info 2>/dev/null)
EOT

[ -n "$verbose" ] && { [ "$count" -gt 0 -o "$cdcount" -gt 0 ] && echo "Adding $count new partitions and $cdcount new cdrom-type devices to /etc/fstab." >&2 || echo "No new partitions found." >&2; }
mv -f "$TMP" /etc/fstab

[ -n "$mkicons" ] && mkdesktophdicons >/dev/null 2>&1

rm -f /var/run/rebuildfstab.pid

[ -n "$DISPLAY" ] && sleep 2

exit 0

JohnnyH
03-08-2007, 03:58 AM
Oh, I've found out that if you edit /usr/sbin/rebuildfstab using KWrite (instead of e.g.vim) it loses its executable status. :?: :?

You can test for this from the command line by
ls -l /usr/sbin/rebuildfstab
and restore executability by
chmod 0755 /usr/sbin/rebuildfstab
(or by right-click on the file in Konqueror, select Properties, Permissions, check "is executable" box).

However, it's still not obvious why your hda1 won't mount :? . What method are you using to mount ?
e.g. have you tried from the command line
mount -t ntfs /dev/hda1 /media/hda1 ?

e.g.are you using the desk-top icon?

e.g.are you using right-click on the device in KDiskFree ?

Israel
03-08-2007, 06:23 AM
I believe I may have found the answer. I was trying to just use the desktop icon, but when I tried to use the command line I was suggested to pick a couple of options first, one of which was ntfsfix:

root@Mephistolist:/home/Israel# ntfsfix /media/hda1
Mounting volume... Error opening partition device: Is a directory
Failed to startup volume: Is a directory
FAILED
Attempting to correct errors... Error opening partition device: Is a directory
FAILED
Failed to startup volume: Is a directory
Volume is corrupt. You should run chkdsk.

I've had a problem with this and even tried running chkdsk /F from the Recovery cd to fix all that, but nothing seems to help? I guess it's just a hardware issue?

JohnnyH
03-08-2007, 10:54 AM
Hmmm, I think the questions need to go further back in the whole process ... I'm not sure whether, or not, you're implying a problem with the windows partition itself...

1) Are you able to mount hda1 from the Live CD | DVD ?
1A) (and if not, was the media integrity validated OK on booting with the cheatcode knoppix testcd ?)

If 1) is OK then we can infer that the problem lies with the HD-installed Knoppix

Otherwise, are you trying to mount either:
2) a known-working Windows partition for working data transfer TO of the Linux system ? (NB if you try FROM Linux it's at possible risk to your NTFS filesystem - numerous postings on the forum refer)
or
3) a Windows partition with a problem to be rescued from Linux ?

If the answer is 2) or 3) the problem would seem to be related to the NTFS partition itself. I'm afraid I can't help much there, not having used NTFS since the days of Windows NT4, and I would not have it on a machine where I also use Linux :wink:
Oh,
4) You tried chkdsk ; if you run whichever of gparted and|or qtparted is on your Knoppix, or a GParted Live CD, does that give any more information?

Israel
03-08-2007, 08:30 PM
1) Are you able to mount hda1 from the Live CD | DVD ?
Yes




if you run whichever of gparted and|or qtparted is on your Knoppix, or a GParted Live CD, does that give any more information?
None useful to this that I see...

JohnnyH
03-08-2007, 09:30 PM
OK, if it was me, at this stage I would re-install the Knoppix system from the live CD | DVD (booting with the testcd cheatcode), configure rebuildfstab and ensure hal is running as described in http://www.knoppix.net/forum/viewtopic.php?t=26759

Israel
03-09-2007, 03:11 AM
When I ran testcd I it said that the kernel image could not be found. I don't understand how this could be when the cd runs so beautifully? And other than not being able to mount my Windoze partition I have no complaints about the hard-disk install from it. I've used it about a month? But I guess I must have a bad download. I guess, I'm off to download the cd again :(

Harry Kuhman
03-09-2007, 04:12 AM
... But I guess I must have a bad download. I guess, I'm off to download the cd again :(There is one test for the ISO that is never wrong, it will confirm a good or bad download: the md5 checksum. If it is right you don't need to do another download and will gain nothing in doing so.

There is a chance that a bad burn or bad media resulted in a bad disc that the md5 checksum would not catch. Testcd might or might not catch this. But it's not the right tool for deciding if you had a bad download.

AJones
03-09-2007, 06:53 PM
Hi Israel:

You seem to be having the same problems I faced JohnnyH and HarryKuhman both have posted here

http://www.knoppix.net/forum/viewtopic.php?t=26802

My Knoppix DVD checks out fine with Md5Sum using testCD. I find this problem to be mostly since this HAL has appeared. I had teh same problem with PC-BSD installation. You can mount hd1 WinXp or any other with as root

root/ mount /media/hda1 then use the Icons on the desktop to open up in Knoqueror. While I think Knoppix 5.1.1 to be lot better than 4.0 I find wierd stuff like GRUB appearing late and booting taking time to start frequently to be odd.

Sorry I cant give you any suggestions

AJ

Israel
03-10-2007, 12:54 AM
root/ mount /media/hda1 doesn't work for me buddy. Thanks for the suggestion though. I just downloaded another copy of Knoppix 5.1 and the checksum matched perfectly. I should be able to set it all back up tonight. If it doesn't work, you'll definitely be hearing back from me.