Linux

How to recover a grub boot partition

The RedHat / CentOS way. Title should be “recover grub boot loader really”! Boot into recovery mode from the linux rescue cd. Type: chroot /mnt/sysimage – this will make your main / partition (currently mounted under /mnt/sysimage) the / partition. Type mount and find which device is your hard disk. This could be sda or […]

Debian Linux Samba

mount: cannot mount block device

I was trying to mount a CIFS / SAMBA share on Debian GNU/Linux 7 (wheezy). I wasn’t being prompted for a password, I would simply get: mount -t cifs -o user=admin //10.1.1.10/BLAH remote/ mount: block device //10.1.1.10/BLAH is write-protected, mounting read-only mount: cannot mount block device //10.1.1.10/BLAH read-only I needed to install “cifs-utils” apt-get install […]

Linux

Finding files and directories in Linux.

Finding files and directories in Linux. Case-insensitive file searching with the locate command It’s easy to perform a case-insensitive file search with the Linux locate command: just add the -i flag. To search my entire filesystem for files and directories that contain the string typeahead, just use this command: locate -i typeahead Case-insensitive file searching […]

Linux

How do I remove empty directories in Linux?

Update: 06/2023 This post is rather dated now. Simply use the find command instead. find /path/to/dir -empty -type d -delete And for empty files: find /path/to/dir -empty -type f -delete Old original post. You can use program called cleanlinks. The cleanlinks program searches the directory tree descended from the current directory for symbolic links whose […]