Advertisements

Tag Archives: ls

Samba share without permission. Directory showing as d———

Server is mounting network share being exported using CIFS

root@linux:~ # df -hP /arq/avf/ROT_EFC
Filesystem Size Used Avail Use% Mounted on
//172.20.1.2/Operacao_ROT_EFC$ 43G 40G 3.2G 93% /arq/avf/ROT_EFC

root@linux:~ # mount | grep ROT_EFC
//172.20.1.2/Operacao_ROT_EFC$ on /arq/avf/ROT_EFC type cifs (rw)

Information about the filesystem on /etc/fstab

root@linux:~ # grep Operacao_ROT_EFC /etc/fstab
//172.20.1.2/Operacao_ROT_EFC$ /arq/avf/ROT_EFC cifs _netdev,user=s-ad-USER1468,pass=userpassword,uid=21376,gid=889,file_mode=0775,dir_mode=0775,domain=setaoffice,cifsacl

There is no permission and it can’t be changed by the Linux server brqsb1valeas890

root@linux:~ # ls -ld /arq/avf/ROT_EFVM /arq/avf/ROT_EFC
d——— 7 user1468 admweb 0 Sep 15 15:53 /arq/avf/ROT_EFC

root@linux:~ # chmod 775 /arq/avf/ROT_EFC
chmod: changing permissions of `/arq/avf/ROT_EFC’: Permission denied

No problem mounting manually

mount -t cifs //172.20.1.2/Operacao_ROT_EFC$ /arq/avf/ROT_EFC -o “username=s-ad-USER1468,domain=setaoffice,uid=21376,gid=889,file_mode=0775,dir_mode=0775”

Rewrote entry in /etc/fstab. Must have been a hidden character

root@linux:~ # umount /arq/avf/ROT_EFC
root@linux:~ # mount /arq/avf/ROT_EFC
root@linux:~ # ls -dl /arq/avf/ROT_EFC
drwxrwxr-x 7 user1468 admweb 0 Sep 15 15:53 /arq/avf/ROT_EFC

Advertisements

Rotate file /var/log/faillog, /var/log/lastlog and /var/log/tallylog

If you are having disk space problems in /var and you found that /var/log/faillog, /var/log/lastlog and /var/log/tallylog are filling up the space and you need to rotate them, you probably don’t need to rotate them

root@linux:~ # df -h /var/log
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vgroot-lv_var_log
4.9G 2.0G 2.8G 42% /var/log

These are sparse files and are occupying minimal disk space. Keep looking for the offender

root@linux:~ # ls -lh /var/log/faillog
-rw——-. 1 root root 258M Apr 25 14:07 /var/log/faillog

root@linux:~ # du -sh /var/log/faillog
624K /var/log/faillog
root@linux:~ # du -h –apparent-size /var/log/faillog
258M /var/log/faillog

root@linux:~ # ls -lh /var/log/lastlog
-rw——-. 1 root root 2.3G May 2 11:05 /var/log/lastlog

root@linux:~ # du -h /var/log/lastlog
348K /var/log/lastlog
root@linux:~ # du -h –apparent-size /var/log/lastlog
2.3G /var/log/lastlog

root@linux:~ # ls -lh /var/log/tallylog
-rw——-. 1 root root 515M May 2 10:42 /var/log/tallylog

root@linux:~ # du -sh /var/log/tallylog
288K /var/log/tallylog
root@linux:~ # du -sh –apparent-size /var/log/tallylog
515M /var/log/tallylog

Source: faillog command create a huge file, like 128GB file (/var/log/faillog)

Why is the /var/log/lastlog file so large?

How to remove files with strange characters

To remove files that contain symbols and unknown characters, list the files with ls -li and take note of the inode number

root@linux:~ # ls -li
total 4420
2495260 -rw——- 1 root root 13810 Jan 28 2011 ????!
2495249 -rw——- 1 root root 13810 Jan 28 2011 ????!

Run the find command and see if it shows the desired file

root@linux:~ # find . -inum 2495260
./????!

And then complete the find command to search, find and remove the file.

root@linux:~ # find . -inum 2495260 -exec rm -i {} \;
rm: remove regular file `./20\36406\b!’? y

ia64dsk: The disk for dev_t d00009b appears to have grown since the partition table was written.

We are seeing a message about a disk to have grown since the partition table was written.

We had a storage migration using an HP MPX200 router

root@hp-ux:~ # dmesg

Mar 19 14:33

09b appears to have grown since the partition table was written.
ia64dsk: The disk for dev_t d00009b appears to have grown since the partition table was written.

To identify the disk, check /dev

root@hp-ux:~ # ls -ltraR /dev | grep 009b
crw-r—– 1 bin sys 13 0x00009b Feb 12 14:29 disk30
brw-r—– 1 bin sys 1 0x00009b Feb 12 14:29 disk30

According to idisk, we need to use -G option but it is not documented on the manual page

root@hp-ux:~ # idisk -p /dev/rdisk/disk30
idisk version: 1.44

EFI Primary Header:
Signature = EFI PART
Revision = 0x10000
HeaderSize = 0x5c
HeaderCRC32 = 0x65182f71
MyLbaLo = 0x1
MyLbaHi = 0x0
AlternateLbaLo = 0x117fffff
AlternateLbaHi = 0x0
FirstUsableLbaLo = 0x40
FirstUsableLbaHi = 0x0
LastUsableLbaLo = 0x117fffbf
LastUsableLbaHi = 0x0
Disk GUID = 9d7ea890-0835-11e4-8000-d6217b60e588
PartitionEntryLbaLo = 0x2
PartitionEntryLbaHi = 0x0
NumberOfPartitionEntries = 0xc
SizeOfPartitionEntry = 0x80
PartitionEntryArrayCRC32 = 0x6c45b3e0

Primary Partition Table (in 512 byte blocks):
Partition 1 (EFI):
Partition Type GUID = c12a7328-f81f-11d2-ba4b-00a0c93ec93b
Unique Partition GUID = 9d7eaaf2-0835-11e4-8000-d6217b60e588
Starting Lba Lo = 0x40
Starting Lba Hi = 0x0
Ending Lba Lo = 0xf9fff
Ending Lba Hi = 0x0
Partition 2 (HP-UX):
Partition Type GUID = 75894c1e-3aeb-11d3-b7c1-7b03a0000000
Unique Partition GUID = 9d7eab10-0835-11e4-8000-d6217b60e588
Starting Lba Lo = 0xfa000
Starting Lba Hi = 0x0
Ending Lba Lo = 0x117377ff
Ending Lba Hi = 0x0
Partition 3 (HPSP):
Partition Type GUID = e2a1e728-32e3-11d6-a682-7b03a0000000
Unique Partition GUID = 9d7eab24-0835-11e4-8000-d6217b60e588
Starting Lba Lo = 0x11737800
Starting Lba Hi = 0x0
Ending Lba Lo = 0x117ff7ff
Ending Lba Hi = 0x0
NOTE: This disk appears to have grown since the partition
table was written. Use idisk with the -G option to
extend the usable space to fill the disk.

There should be a difference in cylinders and blocks between the two disks that is causing this message

Solaris – ls or df error: cannot canonicalize .: Permission denied

On systems that the umask is set to 027, the directory that is created to be used as a mount point appears to have the correct permissions but you can’t get the disk space utilization or list (ls -la) the permissions of the current directory (.) or the level above (..)

user@solaris:~ $ umask
027

user@solaris:~ $ df -k /backup_export
df: cannot canonicalize .: Permission denied

user@solaris:/ # ls -ld /backup_export
drwxr-xr-x 17 oracle oinstall 1024 Dec 12 15:33 /backup_export

You see that with the root user there is no problem to execute the same command you used as a regular user

root@solaris:~ # df -k /backup_export
Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/dadosdg/vol_bkp
92409856 22803105 65256478 26% /backup_export

To solve this problem, umount the filesystem

root@solaris:/ # umount /backup_export

root@solaris:/ # ls -ld /backup_export
drwxr-x— 2 root root 512 Aug 13 2007 /backup_export

Now you apply the permission to make the directory browsable to regular users. I set the permissions to 777 and mounted the filesystem

root@solaris:/ # chmod 777 /backup_export

root@solaris:/ # mount /backup_export

root@solaris:/ # df -k /backup_export
Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/dadosdg/vol_bkp
92409856 22803105 65256478 26% /backup_export

The permissions are back to what used to be and now the error message doesn’t appear anymore

user@solaris:~ $ df -k /backup_export
Filesystem kbytes used avail capacity Mounted on
/dev/vx/dsk/dadosdg/vol_bkp
92409856 22803105 65256478 26% /backup_export

user@solaris:/ # ls -ld /backup_export
drwxr-xr-x 17 oracle oinstall 1024 Dec 12 15:33 /backup_export

%d bloggers like this: