Users online right now: 127 - Login  » search  » forum index  

LS is blank but files are there

gt46l
wrote 1 year ago


reply
I just made a fresh iso off this site and put it on a bootable usb and have begun configuring it like I've done a dozen times before (16 modules total, no gui just cli). Wierdest thing, but some directories show empty when I do an "ls" on them but the files are still there. For example when I do "ls /var/log" shows nothing, it just goes to the next line on the command prompt. Same when I do an "ls -a /var/log", but when I do "cat /var/log/messages" the file is there and I get the log output, it just doesn't show in an "ls". There are a couple other directories like this, but other than that "ls" would appear to work everywhere else. The system is working, and if I know the name of the file I am looking for I can work on it, but this is the weirdest thing I've seen. I've spent a whole day configuring this setup and would rather not start over from scratch. Does anybody have an idea why "ls" isn't working?
 
tonio
wrote 1 year ago


reply
Probably you have read-only setup?

You may change the permissions on the usb device to rw and see if the files are still read-only?

Try that out and hope this helps in some way!
 
vonbiber
wrote 1 year ago


reply
This happens when, for instance you try to 'ls' a directory that you don't own
(and that have no write or read permission for other users).
For example, in a distro with 2 users (root, and an ordinary user) if you do
ls /root
as the ordinary user, you get this message

ls: cannot open directory /root: Permission denied

Do you get a similar message?
What does the command whoami
return? And what does ls -ld /var/log shows?
Check if the user returned by whoami is the same as the one that appears in the second command,
and check the permissions, is it drwx--x--?
 
gt46l
wrote 1 year ago


reply
I'm logged in as root on a fresh install. There shouldn't be permissions issues. As for changing the permissions to rw I've been creating files on it all day/rebooting and then creating more without issues.

"whoami"=root

"ls -ld /var/log" = drwxr-xr-x 74 root 0 4096 May 3 2006 /var/log
 
gt46l
wrote 1 year ago


reply
Maybe getting somewhere now:

ls -la /etc/samba = "total 0"

ls -la /etc/samba/smb.conf = "-rw-r--r-- 1 userid power 388 Apr 22 13:43 /etc/samba/smb.conf"

Going to see if doing a chown will fix this
 
gt46l
wrote 1 year ago


reply
Did "chown root smb.conf"

then

ls -la smb.conf = "-rwxrwxrwx 1 root 0 388 Apr 22 13:43 smb.conf"

but still no luck:

ls -la = "total 0"
 
burninbush
wrote 1 year ago


reply
@ gt461 ...

My first move would be to hide those 16 modules, and boot to always fresh -- see if that solves the ls problem.

If this has always worked for you before, then you must have gotten a bad download, or somehow got some .lzm files that aren't right.

root@slack64-amd64:/mnt/sdb1/slax/base# md5sum *
75d83fea63bdb8f3731fe6634571894c 001-core.lzm
f6c2b47084fab5ca20fa3887cc7d0070 002-xorg.lzm
b9175fa65e5d792e00edf6324aec2817 003-desktop.lzm
77cc5ecd671959f15a38b8af85470798 004-kdeapps.lzm
6f2463ad11070b65883d14810f86210f 005-koffice.lzm
75255e6bdab4a9135b33745dacace88e 006-devel.lzm
root@slack64-amd64:/mnt/sdb1/slax/base#
 
gt46l
wrote 1 year ago


reply
What fixed this was deleting the "/mnt/sda/slax/changes/var/log" and the "/mnt/sda/slax/changes/etc/samba" directories. The posixovl files had been corrupted.
 
burninbush
wrote 1 year ago


reply
What fixed this was deleting the "/mnt/sda/slax/changes/var/log" and the "/mnt/sda/slax/changes/etc/samba" directories. The posixovl files had been corrupted. >gt46l

+++++++++++++

There ya go. The permanent solution to this is to save changes in a slaxsave.dat file.
 
gt46l
wrote 1 year ago


reply
How would I migrate to that, or is that assuming you are starting with a new install from scratch (no changes yet)? Probably seems like a stupid question, but I don't want to blow up my install after 2 weeks setting it up and scripting the way I want it. I want to make sure that making a change like changes=slaxsave.dat will A. save all my pre-dat file changes and B. not lose all my current changes.
Anybody done this before? Is there a process to follow to migrate to this or does it just pick up all the changes and shuv them into the dat file on the first reboot? Does it leave changes diretories that you can delete afterwards?
 
bb as guest
wrote 1 year ago


reply
No, changing to slaxsave.dat will not forward any previous changes, it will be as if you started fresh. The advantage is that there will not be any future corruption from saving changes on a vfat filesystem.

But do you really want to do that? It might be possible, but you'd also be forwarding any corruption, like the problem you had at the head of this thread.

If your current cheatcodes use 'changes=/slax' then look under /slax on your usbstick, may be a subdir named /changes. If so, then boot to always fresh, and then cd to /slax, and run #dir2lzm /changes /zchanges.lzm ... and then when that finishes, and you get a prompt back, copy /zchanges.lzm to /slax/modules, and then rename /changes to /ex-changes, and finally reboot to always fresh again. If your previous changes appear to still be in place, then you can edit your slax.cfg to 'changes=slaxsave.dat' and start with an empty slaxsave.dat with no loss. But be aware, doing this you may be propagating corruption that you simply haven't seen yet. Far safer to start over.
 
jcsoh
wrote 1 year ago


reply
"but I don't want to blow up my install after 2 weeks setting it up and scripting the way I want it"

Only way to be certain to avoid or rather to recover is to back up. If you backed up , you can always restored the settings saved earlier.
 
gt46l
wrote 1 year ago


reply
Thx for both the suggestions. I found a usb stick ripper called imageusb and I backed up my install. Got another usb stick and cloned it so I can work on that w/o affecting my working version. Going to work on the slaxsave.dat migration this week.
 

  » search  » forum index  

Post your reply

Your name (Login):

Message:

These HTML tags are allowed: <quote>, <b>, <u>, <i>, <pre>, <code>, <small>, <h1>, <h2>, <h3>, <li>



Slax is generously supported by: P&P Software GmbH and wisol technologie GmbH