#linux

Alter system calls with LD_PRELOAD

Published at October 17, 2021 ·  4 min read

Use LD_PRELOAD to alter library calls I have a program that is failing because it is making a system call to change permissins on a file with chmod, fchmodat, and fchmod -S 2. The program does not own the file, and doesn’t need to change the permission but fails with -1 EPERM on this call. This was determined with strace -f -e chmod,fchmod,fchmodat $program Example program This program simulates the behaviour of the application with the issue....


Mount a block device image

Published at October 16, 2021 ·  2 min read

How to mount a block device image Task: An image of a block divice has been created with dd for data recovery purposes. Mount the filesystem from the image and access files. Review image partition information Confirm that the image size matches the size of the source block device. If the size is incorrect review the block device options or try another program such as ddrescue to read a failing block device....


DevOps notes

Published at September 6, 2021 ·  5 min read

Notes from a DevOps class....


Linux kernel module basics

Published at August 19, 2021 ·  2 min read

A basic example of a loadable kernel module, loading, debugging and build....


zpool reimport

Published at July 30, 2021 ·  2 min read

Import ZFS pool into a new computer In this example hardware has failed and the zpool disks are connected to a new computer. Need to reconstruct the zpool filesystem for continued data use. All disks from the zpool are now connected to a new computer. Find the pool root@nas:~# zpool import pool: zfsdata id: 466262796876421602 state: ONLINE status: The pool was last accessed by another system. action: The pool can be imported using its name or numeric identifier and the '-f' flag....


Arbitrary Scaling X

Published at August 31, 2018 ·  2 min read

I’m a bargain hunter. Lately I have been playing with some low powered windows cloudbooks. I picked one up “refurbished”, the box and packaging looked new, for less than $200. It has a full HD 14" screen which I was searching for as the similar size 720p model I had before was a little on the pixeley side for text. Also, it was repurposed as a computer for a student. As usual, I made a backup image of the internal storage in case the next next person wants windows....



Recent posts

Alter system calls with LD_PRELOAD

Mount a block device image

DevOps notes

Linux kernel module basics

zpool reimport


Archives

2021 (5)
2019 (2)
2018 (7)