Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#19073 - 01/10/2000 03:21 ln -s /proc/mounts /etc/mtab -- don't
borislav
addict

Registered: 30/04/2000
Posts: 420
Loc: Sunnyvale, CA, USA
I finally got around to poking inside the player filesystem today. One of the first things I did was "ln -s /proc/mounts /etc/mtab" which gets mount and df working.

A while later I wanted to sync some more songs and discovered that sync no longer works... Not from emplode, not from emptool. I was about to blame it on the 1.01-rc2 release which I'd just upgraded to but before reporting a bug I thought I'd back out the one change I did and... welll, now it works again.

Is it possible to have both df and sync working?

Borislav


Top
#19074 - 01/10/2000 05:40 Re: ln -s /proc/mounts /etc/mtab -- don't [Re: borislav]
altman
carpal tunnel

Registered: 19/05/1999
Posts: 3457
Loc: Palo Alto, CA
df works if you put the filesystem after it, eg "df /" or "df /drive0". The ln breaks fsck, and we've not had time to work out why. The sync fails as the fsck gets confused.

Hugo



Top
#19075 - 02/10/2000 03:32 Re: ln -s /proc/mounts /etc/mtab -- don't [Re: altman]
schofiel
carpal tunnel

Registered: 25/06/1999
Posts: 2993
Loc: Wareham, Dorset, UK
Are you telling fsck to follow symbolic (soft) links?

One of the few remaining Mk1 owners... #00015
_________________________
One of the few remaining Mk1 owners... #00015

Top
#19076 - 02/10/2000 04:21 Re: ln -s /proc/mounts /etc/mtab -- don't [Re: schofiel]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
Rob,
fsck.ext2 reads /etc/mtab to verify the filesystem isn't mounted. If it's mounted it will isssue a warning and waits for a reply. No check is performed to verify that /etc/mtab is a symlink; it just reads /proc/mounts as if it is /etc/mtab.

Frank van Gestel
_________________________
Frank van Gestel

Top
#19077 - 02/10/2000 04:47 Re: ln -s /proc/mounts /etc/mtab -- don't [Re: fvgestel]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
To use df you can set the following alias in your .profile :

alias df='/sbin/df `echo \`cat /proc/mounts | sed "s/ [^/].*$//" | sed "s/^.* //"\``'

Please note the difference between single, double and backquotes ( ' " ` )

Frank van Gestel
_________________________
Frank van Gestel

Top
#19078 - 03/10/2000 15:02 Re: ln -s /proc/mounts /etc/mtab -- don't [Re: fvgestel]
smu
old hand

Registered: 30/07/2000
Posts: 879
Loc: Germany (Ruhrgebiet)
Hi Frank

To use df you can set the following alias in your .profile :
alias df='/sbin/df `echo \`cat /proc/mounts | sed "s/ [^/].*$//" | sed "s/^.* //"\``'

Please note the difference between single, double and backquotes ( ' " ` )


The "echo" part is actually superfluous (sp?), and the two sed commands can be joined to make it a bit faster and easier to read. The result is the following alias:
alias df='df       `cat /proc/mounts  | sed "s/ [^/].*$//;s/^.* //"`'
++ | | | | | | | |
call df -------+ +----------+---+ +++ +------+---+ +---+--+
as parameter, output /proc/mounts --+ | | |
use sed to manipulate each line, ------------+ | |
first remove anything following the last "/" ------------+ |
then remove anything before the first " " -------------------------+

Just like you said: Be careful regarding the double / single quotes, back ticks etc.

cu,
sven
_________________________
proud owner of MkII 40GB & MkIIa 60GB both lit by God and HiJacked by Lord

Top
#19079 - 03/10/2000 15:50 Re: ln -s /proc/mounts /etc/mtab -- don't [Re: smu]
bonzi
pooh-bah

Registered: 13/09/1999
Posts: 2401
Loc: Croatia
One could also add redirection of stderr to null ( 2>/dev/null) to get rid of complaint about not being able to read table of mounted filesystems.

(BTW, no brownie points for me this time: instead of alias I made a script that symlinked /etc/mtab, run df, than unlinked it again. Hardly elegant and does not work with filesystems mounted RO. Thanks for reminded me aliases existed (needless to say, my profiles and rcs that got migrated and bloated from system so system over the years have hundreds of aliases and short shell functions, and yet I wrote a damned script!) ).

Cheers!

Dragi "Bonzi" Raos
Zagreb, Croatia
Q#5196, MkII#80000376, 18GB green
_________________________
Dragi "Bonzi" Raos Q#5196 MkII #080000376, 18GB green MkIIa #040103247, 60GB blue

Top
#19080 - 03/10/2000 16:15 Re: ln -s /proc/mounts /etc/mtab -- don't [Re: smu]
fvgestel
old hand

Registered: 12/08/2000
Posts: 702
Loc: Netherlands
You're right, combining the two makes sense.
The echo command is only needed on the serial console for some dark reason;
see here for other strange console behaviour

Frank van Gestel
_________________________
Frank van Gestel

Top