View previous topic :: View next topic |
Author |
Message |
pablo_supertux Advocate
Joined: 25 Jan 2004 Posts: 2937 Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)
|
Posted: Fri Sep 17, 2004 12:03 pm Post subject: Mounting partition from symlinks |
|
|
Hi @ all:
I have following:
Code: |
rex@supertux:~> grep hdc /etc/fstab
/dev/hdc /media/cdrom auto ro,noauto,user,exec 0 0
rex@supertux:~> ls -al dvd
lrwxrwxrwx 1 rex users 13 Sep 14 15:46 dvd -> /media/cdrom/
|
When I was a SuSE Linux user, I use to mount my CD-ROM like this
Code: |
rex@supertux:~> mount dvd
|
I had the same fstab (well. almost the same) configuration like now with gentoo and it worked. Today I use mount dvd and I get this error:
Code: |
rex@supertux:~> mount dvd
mount: can't find /home/rex/dvd in /etc/fstab or /etc/mtab
|
Why? I mean, why did it function under SuSE and it doesn't function under Gentoo? Is there a kernel problem, have I forgotten something? What shall I do? _________________ A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth! |
|
Back to top |
|
|
hecatomb Guru
Joined: 02 Sep 2004 Posts: 525
|
Posted: Fri Sep 17, 2004 1:09 pm Post subject: |
|
|
I straced the mount call on a suse machine:
Quote: | ...
getcwd("/home/user", 4095) = 24
readlink("/home/user/dvd", "/media/dvd", 4096) = 10
... |
What does strace mount dvd show on your gentoo?
Sorry I'm not at home, so can't test this on my machine! |
|
Back to top |
|
|
pablo_supertux Advocate
Joined: 25 Jan 2004 Posts: 2937 Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)
|
Posted: Fri Sep 17, 2004 4:44 pm Post subject: |
|
|
hecatomb wrote: | I straced the mount call on a suse machine:
Quote: | ...
getcwd("/home/user", 4095) = 24
readlink("/home/user/dvd", "/media/dvd", 4096) = 10
... |
What does strace mount dvd show on your gentoo?
Sorry I'm not at home, so can't test this on my machine! |
command not found?
Well, after having emerged trace I get this:
Code: |
execve("/bin/mount", ["mount", "dvd"], [/* 46 vars */]) = 0
uname({sys="Linux", node="supertux", ...}) = 0
brk(0) = 0x805c000
open("/etc/ld.so.preload", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY) = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=94666, ...}) = 0
mmap2(NULL, 94666, PROT_READ, MAP_PRIVATE, 3, 0) = 0x40013000
close(3) = 0
open("/lib/libc.so.6", O_RDONLY) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 Y\1\000"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1180984, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4002b000
mmap2(NULL, 1112932, PROT_READ|PROT_EXEC, MAP_PRIVATE, 3, 0) = 0x4002c000
mmap2(0x40136000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED, 3, 0x109) = 0x40136000
mmap2(0x4013a000, 7012, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x4013a000
close(3) = 0
munmap(0x40013000, 94666) = 0
open("/dev/urandom", O_RDONLY) = 3
read(3, "\266\363\20\367\347C\10\232\277n\23\214\222\247O\341\5"..., 32) = 32
close(3) = 0
brk(0) = 0x805c000
brk(0x807d000) = 0x807d000
brk(0) = 0x807d000
umask(033) = 022
open("/dev/null", O_RDWR|O_LARGEFILE) = 3
close(3) = 0
getuid32() = 1000
geteuid32() = 1000
lstat64("/etc/mtab", {st_mode=S_IFREG|0644, st_size=284, ...}) = 0
getcwd("/home/rex", 4095) = 10
readlink("/home/rex/dvd", "/media/cdrom/", 4096) = 13
umask(077) = 033
open("/etc/fstab", O_RDONLY|O_LARGEFILE) = 3
umask(033) = 077
fstat64(3, {st_mode=S_IFREG|0644, st_size=2029, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40013000
read(3, "# /etc/fstab: static file system"..., 4096) = 2029
read(3, "", 4096) = 0
close(3) = 0
munmap(0x40013000, 4096) = 0
umask(077) = 033
open("/etc/mtab", O_RDONLY|O_LARGEFILE) = 3
umask(033) = 077
fstat64(3, {st_mode=S_IFREG|0644, st_size=284, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40013000
read(3, "/dev/hda9 / ext3 rw,noatime 0 0\n"..., 4096) = 284
read(3, "", 4096) = 0
close(3) = 0
munmap(0x40013000, 4096) = 0
write(2, "mount: can\'t find /home/rex/dvd "..., 58mount: can't find /home/rex/dvd in /etc/fstab or /etc/mtab) = 58
write(2, "\n", 1
) = 1
exit_group(1)
|
I must admit, that I don't understand what trace is trying to tell me. _________________ A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth! |
|
Back to top |
|
|
hecatomb Guru
Joined: 02 Sep 2004 Posts: 525
|
Posted: Mon Sep 20, 2004 7:59 am Post subject: |
|
|
Hi!
strace (system trace) is a very useful tool. It shows all system calls which are made by the given executable.
Quote: | Code: | ...
getcwd("/home/rex", 4095) = 10
readlink("/home/rex/dvd", "/media/cdrom/", 4096) = 13
umask(077) = 033
open("/etc/fstab", O_RDONLY|O_LARGEFILE) = 3
umask(033) = 077
fstat64(3, {st_mode=S_IFREG|0644, st_size=2029, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40013000
read(3, "# /etc/fstab: static file system"..., 4096) = 2029
read(3, "", 4096) = 0
close(3)
... |
|
Seems to resolve the link (readlink)! And the opens /etc/fstab and reads it. But seems not to be able to find the entry for /media/cdrom. This is very strange.
Code: | ...
getcwd("/home/user", 4095) = 24
readlink("/home/user/dvd", "/media/dvd", 4096) = 10
readlink("/media", 0xbfffe010, 4096) = -1 EINVAL (Invalid argument)
readlink("/media/dvd", 0xbfffe010, 4096) = -1 EINVAL (Invalid argument)
umask(077) = 022
open("/etc/fstab", O_RDONLY|O_LARGEFILE) = 3
umask(022) = 077
fstat64(3, {st_mode=S_IFREG|0644, st_size=790, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x4002a000
read(3, "/dev/hda3 / "..., 4096) = 790
read(3, "", 4096) = 0
close(3) = 0
munmap(0x4002a000, 4096) = 0
stat64("/dev/dvd", {st_mode=S_IFBLK|0600, st_rdev=makedev(22, 0), ...}) = 0
open("/dev/dvd", O_RDONLY|O_LARGEFILE) = -1 ENOMEDIUM (No medium found)
... |
This is the important part out of my strace output. Last line is because I have no dvd in my drive!
Sorry but I can't get the point where this fails on your system. |
|
Back to top |
|
|
pablo_supertux Advocate
Joined: 25 Jan 2004 Posts: 2937 Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)
|
Posted: Mon Sep 20, 2004 8:53 am Post subject: |
|
|
I don"t think, this is the probelm (with /dev/dvd) and I am sure, that I have /dev/dvd because I am able to run mplayer with a dvd.
But I have the problem with all symlinks to /media/cdrom and /media/cdrom is in my /etc/fstab.
Ok, this is not bad, I've wrotten already a mount-script for my system, thank you for your help _________________ A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth! |
|
Back to top |
|
|
hecatomb Guru
Joined: 02 Sep 2004 Posts: 525
|
Posted: Mon Sep 20, 2004 9:59 am Post subject: |
|
|
I have no access to a gentoo box at the moment. But at home I'll test this symlink-mount thing! I'll let you know... |
|
Back to top |
|
|
pablo_supertux Advocate
Joined: 25 Jan 2004 Posts: 2937 Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)
|
Posted: Mon Sep 20, 2004 2:54 pm Post subject: |
|
|
Ok, thanks. I don't have access niether, because I am not an home. _________________ A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth! |
|
Back to top |
|
|
hecatomb Guru
Joined: 02 Sep 2004 Posts: 525
|
Posted: Wed Sep 22, 2004 10:22 am Post subject: |
|
|
Sorry but this doesn't work on my gentoo box too!
Maybe SuSE patched their mount (found in util-linux)
I got this src.rpm from the ftp converted it to tar.gz (using alien) and search through the pachtes but no success
The only thing I found was in the changelog:
Quote: | ...
* Sat Sep 01 2001
- Let mount follow symlinks again
... |
Aliases may be better "style" for such things than shellscripts:
Code: | alias dvd="mount /media/cdrom" |
|
|
Back to top |
|
|
pablo_supertux Advocate
Joined: 25 Jan 2004 Posts: 2937 Location: Somewhere between reality and Middle-Earth and in Freiburg (Germany)
|
Posted: Wed Sep 22, 2004 3:52 pm Post subject: |
|
|
This is a good idea (I mean with the alias).
I was just wondering, why this didn't function, I wrote my own mounting script and I don't really need this feature.
Thank you for your help and time _________________ A! Elbereth Gilthoniel!
silivren penna míriel
o menel aglar elenath,
Gilthoniel, A! Elbereth! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|