Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "@context": [
- "https://www.w3.org/ns/activitystreams",
- "https://w3id.org/security/v1",
- {
- "lemmy": "https://join-lemmy.org/ns#",
- "litepub": "http://litepub.social/ns#",
- "pt": "https://joinpeertube.org/ns#",
- "sc": "http://schema.org/",
- "ChatMessage": "litepub:ChatMessage",
- "commentsEnabled": "pt:commentsEnabled",
- "sensitive": "as:sensitive",
- "matrixUserId": "lemmy:matrixUserId",
- "postingRestrictedToMods": "lemmy:postingRestrictedToMods",
- "removeData": "lemmy:removeData",
- "stickied": "lemmy:stickied",
- "moderators": {
- "@type": "@id",
- "@id": "lemmy:moderators"
- },
- "expires": "as:endTime",
- "distinguished": "lemmy:distinguished",
- "language": "sc:inLanguage",
- "identifier": "sc:identifier"
- }
- ],
- "type": "Note",
- "id": "https://lemmy.cafe/comment/1368187",
- "attributedTo": "https://lemmy.cafe/u/Illecors",
- "to": [
- "https://www.w3.org/ns/activitystreams#Public"
- ],
- "cc": [
- "https://lemmy.ml/c/linux",
- "https://lemmy.dbzer0.com/u/Harry_h0udini"
- ],
- "content": "<pre style=\"background-color:#ffffff;\">\n<span style=\"color:#323232;\">#!/usr/bin/env bash\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">exec > /tmp/sda-debug.log 2>&amp;1 # The last "word" of this line is 4 chars - two, greater than, ampersand and one\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\"># strict mode\n</span><span style=\"color:#323232;\">set -euxo pipefail\n</span><span style=\"color:#323232;\">IFS=$'\\n\\t'\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">TARGET="/tmp/myprecious"\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">umount /dev/sda4 || true\n</span><span style=\"color:#323232;\">mkdir -p "$TARGET"\n</span><span style=\"color:#323232;\">mount /dev/sda4 "$TARGET"\n</span><span style=\"color:#323232;\">ls -la "$TARGET" # attempt read\n</span><span style=\"color:#323232;\">touch "$TARGET"/testfile # attempt write\n</span><span style=\"color:#323232;\">\n</span><span style=\"color:#323232;\">rm "$TARGET"/testfile\n</span><span style=\"color:#323232;\">umount "$TARGET"\n</span><span style=\"color:#323232;\">rmdir "$TARGET"\n</span></pre>\n<ul>\n<li>Save this to a file somewhere, let’s call it <code>sda-debug.sh</code></li>\n<li>Make the script executable: <code>chmod +x sda-debug.sh</code></li>\n<li>Run it as root: <code>sudo ./sda-debug.sh</code></li>\n<li>Paste the content of <code>/tmp/sda-debug.log</code> here</li>\n</ul>\n<hr />\n<p>EDIT: changed the script to log everything to a file for easier copy-past-ability.</p>\n",
- "inReplyTo": "https://lemmy.dbzer0.com/post/2570805",
- "mediaType": "text/html",
- "source": {
- "content": "```\n#!/usr/bin/env bash\n\nexec > /tmp/sda-debug.log 2>&1 # The last \"word\" of this line is 4 chars - two, greater than, ampersand and one\n\n# strict mode\nset -euxo pipefail\nIFS=$'\\n\\t'\n\nTARGET=\"/tmp/myprecious\"\n\numount /dev/sda4 || true\nmkdir -p \"$TARGET\"\nmount /dev/sda4 \"$TARGET\"\nls -la \"$TARGET\" # attempt read\ntouch \"$TARGET\"/testfile # attempt write\n\nrm \"$TARGET\"/testfile\numount \"$TARGET\"\nrmdir \"$TARGET\"\n```\n\n\n- Save this to a file somewhere, let's call it `sda-debug.sh`\n- Make the script executable: `chmod +x sda-debug.sh`\n- Run it as root: `sudo ./sda-debug.sh`\n- Paste the content of `/tmp/sda-debug.log` here\n\n___________\nEDIT: changed the script to log everything to a file for easier copy-past-ability.",
- "mediaType": "text/markdown"
- },
- "published": "2023-08-23T07:08:10.894383+00:00",
- "updated": "2023-08-23T09:25:34.727854+00:00",
- "tag": [
- {
- "href": "https://lemmy.dbzer0.com/u/Harry_h0udini",
- "type": "Mention"
- }
- ],
- "distinguished": false,
- "language": {
- "identifier": "en",
- "name": "English"
- },
- "audience": "https://lemmy.ml/c/linux"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement