Ravas coding goodies

For discussions about programming and projects not necessarily associated with Porteus.
User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Ravas coding goodies

Post#196 by Ed_P » 17 Oct 2023, 18:35

Rava wrote:
17 Oct 2023, 07:33
awk and print. awk can do that, and if by print you mean the printf function, that can do so as well. Alas! I hardly use these so I do not know the needed code necessary for accomplishing your goals off the top of my head. (I am more of a less and sed kind of guy)
Thisis what I'm playing with to get the date field to align Basically trying to check the 1st 2 bytes of the date and if they are not numeric print with a space added before them.

Code: Select all

awk '/\.iso$/  { if (${6:0:2} != "^[0-9]$") print " "$5,$6,$NF}' testdisk2023.log
And as you will find the code doesn't work. :wall:

Added in 8 minutes 47 seconds:
Code that lists the log file with the date problem.

Code: Select all

guest@porteus:/mnt/sda6$ awk '/\.iso$/  {print $5,$6,$NF}' testdisk2023.log
454033408 25-Mar-2023 /ISOs/PorteuX/porteux-v0.2-gnome-42.9-stable-x86_64.iso
427819008 22-Mar-2023 /ISOs/PorteuX/porteux-v0.2-mate-1.27-stable-x86_64.iso
445644800 18-Apr-2023 /ISOs/PorteuX/porteux-v0.3-lxqt-1.3.0-stable-x86_64.iso
437256192 17-Apr-2023 /ISOs/PorteuX/porteux-v0.3-mate-1.27.1-stable-x86_64.iso
445644800 22-May-2023 /ISOs/PorteuX/porteux-v0.4-lxqt-1.3.0-stable-x86_64.iso
434110464 29-Jun-2023 /ISOs/PorteuX/porteux-v0.5-xfce-4.16-current-x86_64.iso
425721856 10-Jul-2023 /ISOs/PorteuX/porteux-v0.5-xfce-4.18-current-x86_64.iso
418381824 16-Aug-2023 /ISOs/PorteuX/porteux-v0.5-xfce-4.18-stable-x86_64.iso
428867584 8-Sep-2023 /ISOs/PorteuX/porteux-v0.6-xfce-4.18-current-x86_64.iso
419430400 7-Sep-2023 /ISOs/PorteuX/porteux-v0.6-xfce-4.18-stable-x86_64.iso
375834624 24-Mar-2023 /ISOs/Porteus-CINNAMON-v5.0-x86_64-230217.iso
375834624 10-Apr-2023 /ISOs/Porteus-CINNAMON-v5.0-x86_64-230402.iso
395055104 11-Apr-2023 /ISOs/Porteus-CINNAMON-v5.0-x86_64-230406.iso
395634688 22-Apr-2023 /ISOs/Porteus-CINNAMON-v5.0-x86_64-230421.iso
395929600 20-May-2023 /ISOs/Porteus-CINNAMON-v5.0-x86_64-230430.iso
409411584 6-Aug-2023 /ISOs/Porteus-CINNAMON-v5.0-x86_64-230616-6.3.13.iso
430700544 17-Aug-2023 /ISOs/Porteus-CINNAMON-v5.0-x86_64-230616-6.4.10.iso
441257984 19-Aug-2023 /ISOs/Porteus-CINNAMON-v5.0-x86_64-230616-6.4.11-fulalas.iso
Added in 3 minutes 41 seconds:
This option doesn't work either.

Code: Select all

awk '/\.iso$/  { if (${6:1:1} == "-") print " "$5,$6,$NF}' testdisk2023.log
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Ravas coding goodies

Post#197 by Rava » 17 Oct 2023, 19:28

I know from C (the language) that there is a padding thingy printf() can use, but I do not recall details.
Stackoverload should be the correct site to ask such questions (or search it first, maybe it was asked and answered already)When I have a question and get no answer in here and none in linuxquestions, i go to Stackoverload (coding) or some of its sister sites (e.g. they also have a more generic unix one that is not about coding)
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Ravas coding goodies

Post#198 by Ed_P » 17 Oct 2023, 21:17

Or this:

Code: Select all

guest@porteus:/mnt/sda6$ awk `/\.iso$/  ' if (${6:1:1} == "-") print " "$5,$6,$NF '` testdisk2023.log
bash: /.iso$/: No such file or directory
awk: cmd. line:1: testdisk2023.log
awk: cmd. line:1:             ^ syntax error
guest@porteus:/mnt/sda6$ 
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Ravas coding goodies

Post#199 by Rava » 17 Oct 2023, 21:45

@Ed_P
stackOverLoad is your friend. Just follow the rules of each community. Especially when it comes to coding here is no better site where professionals help you - as long as you can show them you already tried for yourself, but failed.
Cheers!
Yours Rava

donald
Full of knowledge
Full of knowledge
Posts: 2074
Joined: 17 Jun 2013, 13:17
Distribution: Porteus 3.2.2 XFCE 32bit
Location: Germany

Ravas coding goodies

Post#200 by donald » 18 Oct 2023, 10:36

@Ed
How about this one:

Code: Select all

column -t -o '   ' test.log > new.log
It does at least align the columns properly.

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Ravas coding goodies

Post#201 by Ed_P » 18 Oct 2023, 15:25

column :o I've never heard of "column" before donald. Thank you. :)

Code: Select all

guest@porteus:~$ column -t  -o '  ' /mnt/sda6/testdisk2023.log

86720  -r--r--r--  0  0  6281       26-Jun-2023  09:56  share/xed/plugins/wordcompletion/xed-wordcompletion-configure.ui                                                                                                                                                                                                                                                                                                                                                                                                                                 
86721  -r--r--r--  0  0  1088       8-Jun-2023   07:09  share/xreader/hand-open.png  
86811  -r--r--r--  0  0  908        8-Jun-2023   07:10  share/xviewer/pixmaps/thumbnail-frame.png                                                                                                                                                                                                                                                                                                                                                                                                                                                        
86813  -r--r--r--  0  0  2857       28-Apr-2023  09:59  share/zenity/zenity-calendar.png                                                   
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Ravas coding goodies

Post#202 by Rava » 18 Oct 2023, 16:16

Ed_P wrote:
18 Oct 2023, 15:25
column :o I've never heard of "column" before donald. Thank you. :)
I do not recall it ever having used it either. And it is such a handy tool. Thanks donald.
And of course, man column is you friend.

Anyhow, thanks to man column I now also learned about colrm - remove columns from a file
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Ravas coding goodies

Post#203 by Rava » 21 Oct 2023, 01:33

A small improvement can make a lot of difference.

I have an help.EMPTY that is executable, but mainly is there as template for me when creating a new version of one of my many help.* scripts.

The core of it was like this in the old version:

Code: Select all

cat <<EOF
EOF
It is meant that whatever info I want to have in this help.whatever to be put in between these lines like so for a more or less useless help.lorem_ipsum:

Code: Select all

cat <<EOF
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
EOF
And finally this is the new much improved version of my help.EMPTY template:

Code: Select all

cat <<EOF|fold -sw $(tput cols)
EOF

Here the difference using ./help.lorem_ipsum and ./help.lorem_ipsum.old (I presume you can guess the only difference in code between these two versions from what I wrote above)

I use [ quote ] instead of [ code ] so that I can better show you the broken newline created by ./help.lorem_ipsum.old - and I can simulate the coloured output as well.
root@rava:/tmp# ./help.lorem_ipsum
help.lorem_ipsum V0.1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
incididunt ut labore et dolore magna aliqua.

root@rava:/tmp# ./help.lorem_ipsum.old
help.lorem_ipsum.old V0.1
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor i
ncididunt ut labore et dolore magna aliqua.

root@rava:/tmp#
:celebrate3:
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Ravas coding goodies

Post#204 by Rava » 25 Oct 2023, 05:04

Let us presume the following:

In a certain folder you have some scripts. They are not meant to be globally accessible and are meant to write their resulting files into the folder they sit in.
To make it more easy, you not use a way to capture the path where the script sits, and you not use a path but only the filename for the resulting file names the script will create.

For now let's assume a simple downloading script:

Code: Select all

#!/bin/bash
#	https://example.com/watch/myseries-dub-episode-1.html
wget -c "https://example.com/watch/myseries-dub-episode-1.mp4" -O "My Series 01.mp4" && notify-send -i info -t 0 "Downloading 1" "finished" || notify-send -i error -t 0 "Downloading 1" "failed"
wget -c "https://example.com/watch/myseries-dub-episode-2.mp4" -O "My Series 02.mp4" && notify-send -i info -t 0 "Downloading 2" "finished" || notify-send -i error -t 0 "Downloading 2" "failed"
echo ▓▓▓ press enter / return ▓▓▓
read
and it all sits in, let's say, "/mnt/sda2/video/My Series/" as wget.sh and is executable and readable for user guest.

Now there are more than one ways to execute this script. Would all ways lead to the same results? and would at least one way lead to unexpected consequences when the script was slightly different?

The first, and to me most obvious way executing this script is:
Open a guest terminal

Code: Select all

guest@rava:/ $cd "/mnt/sda2/video/My Series/"
or

Code: Select all

guest@rava:/ $cd /mnt/sda2/video/My\ Series/
and execute it like so:

Code: Select all

guest@rava:/mnt/sda2/video/My Series $ ./wget.sh
No issues there, the script will work as long as it is bug-free, and it will save its files [presuming the URLs you gave it are valid (which in my example case are not)] - in this case the resulting videos like so:

Code: Select all

/mnt/sda2/video/My Series/My Series 01.mp4
/mnt/sda2/video/My Series/My Series 02.mp4
Now, another way executing a script or program not in your $PATH is by its full name. Let's presume you are in /etc and you do this:

Code: Select all

guest@rava:/etc $ "/mnt/sda2/video/My Series/wget.sh"
It would execute the script okay, but the script would try writing the files into /etc and guest should have no right to write into /etc resulting in an error.

Another way executing a script not in your $PATH is like so:

Code: Select all

guest@rava:/mnt/sda2/video/My Series $ . wget.sh
In the above example, that would work okay as well. You are in the correct target folder after all.
Still, the last technique executing a script can lead to unexpected consequences. Not with how the example script is coded.

But let's assume your script is more complex and it checks certain conditions. Like exiting with an error code and a message when started as user root. Or exiting with an error code and a message when not started as user root. Or it is checking for any other conditions that are needed; e.g. it relies on certain programs, let's say it converts images and uses mogrify for that: no mogrify, the script cannot work.

To check for the availability of mogrify, you can have a

Code: Select all

if [ ! test if condition X is met ]; then
     echo "$scriptname:  condition X is NOT met! Aborting!"
     exit 1
fi
The " ! test if condition X is met " is example code to illustrate a test, it is like this not a working bash or sh script code.

Now when that test would trigger because its condition is not met, what would happen?
This part

Code: Select all

     echo "$scriptname:  condition X is NOT met! Aborting!"
     exit 1
would be executed.

What would happen when you executed the script as

Code: Select all

guest@rava:/mnt/sda2/test/test1 $ . test1.sh
?
Since it runs "as the shell itself" (to put it in layman's terms) and not in an new instance of the shell as it would be when executed like so

Code: Select all

guest@rava:/mnt/sda2/test/test1 $ ./test1.sh
the "exit 1" would be executed by the shell itself, and without the ability to read the error message the terminal window or the tab in the terminal window will close.

Since that is what you told the shell to do. When you did a previous "su -" in that terminal, then it would only exit the current root instance of the shell and the one that started the "su -" instance is back in session. In this case you could see the error, but when there is only one instance of bash started in that terminal or in that tab of a terminal, you will not see an error and only the closing of that window or that tab.

And I presume that is not what you want the script to to. Let us use the shell itself to create a test script and make it executable and execute it:

Code: Select all

guest@rava:/tmp$ echo '#!/bin/bash
> if [ true ] ; then
> echo Dummy Condition not met. Exiting.
> exit 1
> fi
> echo all is well, normal execution.
> ' >test.sh
guest@rava:/tmp$ cat test.sh 
#!/bin/bash
if [ true ] ; then
echo Dummy Condition not met. Exiting.
exit 1
fi
echo all is well, normal execution.

guest@rava:/tmp$ chmod a+x test.sh 
guest@rava:/tmp$ ./test.sh 
Dummy Condition not met. Exiting.
guest@rava:/tmp$ echo $?
1
guest@rava:/tmp$ 
All is well when you execute it like "./test.sh" and it returns the return value of "1" just like you told it to.

I cannot show you what it looks like when executing that script as ". test.sh" since that would only close the current tab of my xfce4-terminal.

But I can use "su -" to create a new instance of the shell, a root instance, and since the script can be executed by everyone, root shall execute it like ". test.sh":

Code: Select all

guest@rava:/tmp$ su -
Password: 
root@rava:~# cd /tmp/
root@rava:/tmp# . test.sh 
Dummy Condition not met. Exiting.
guest@rava:/tmp$ echo $?
1
guest@rava:/tmp$ 
As you can see, I am back as user guest since the executing of ". test.sh" executed "exit 1" in the very instance of the root-bash itself, and thus the root instance of the shell exited with the given error code of "1".

Therefore, the usual way you should execute a script not in your path is by moving into the folder the script itself sits in and execute it like

Code: Select all

./your-script.sh

Cave!
And yet another issue with using ". /path/to/file" without much thought: Executed like this will execute any kind of file, or trying to, even plain text files not meant as program or scripts.
In the best case scenario your shell will only complain, but in the worst case code would be executed not meant to be executed and that could create more or less serious issues.
So best only use ". /path/to/file" when you know what you are doing and when there is a reason why that /path/to/file should be executed in the very shell instance itself.

Like when updating your aliases+functions file and giving it a test-run.


HTH!
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Ravas coding goodies

Post#205 by Rava » 28 Oct 2023, 02:26

Rava wrote:
28 Oct 2023, 02:22
https://www.howtouselinux.com/post/6-un ... -attention
In recent months, I’ve encountered numerous articles with titles such as “20 Linux Commands You Should Know” or “Linux Survival Guide.”
However, most of these articles cover basic commands like ls or echo.
Considering that my audiences are already familiar with these foundational commands, this article takes a different approach.
This collection includes commands that are more advanced and can help you become better at managing a Linux system.
  1. ss — display detailed information about socket connections
  2. Shell Job control in Linux shell
  3. openssl command in Linux – SSL certificate tool
  4. strace command in Linux – tracing system calls made by processes
  5. dd command in Linux – copy data
  6. dig command in Linux – interact with DNS

─────────────────────────────────────────────────────────

https://github.com/tldr-pages
tldr pages
📚 Collaborative cheatsheets for console commands
Yay! Console aka terminal aka CLI commands.
:)
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Ravas coding goodies

Post#206 by Rava » 30 Oct 2023, 02:45

How to calculate time since a known date to now in the shell (or in a shell script)
To get sensible output, use the seconds2time function. I have loaded that function into every instance of all of my terminals:

Code: Select all

root@rava:/# type seconds2time
seconds2time is a function
seconds2time () 
{ 
    local T=$1;
    local D=$((T/60/60/24));
    local H=$((T/60/60%24));
    local M=$((T/60%60));
    local S=$((T%60));
    if [[ ${D} != 0 ]]; then
        if [[ ${D} = 1 ]]; then
            printf '%d day %02d:%02d:%02d' $D $H $M $S;
        else
            printf '%d days %02d:%02d:%02d' $D $H $M $S;
        fi;
    else
        printf '%02d:%02d:%02d' $H $M $S;
    fi
}
root@rava:/# 
The calculation.

Let's presume the date/time you want to calculate to now is: "27 Oct 2023 05:58"
date -d "27 Oct 2023 05:58" +%s will convert that into unix Epoch (seconds since 1. Jan 1970 00:00)

Code: Select all

root@rava:/# date -d "27 Oct 2023 05:58" +%s
1698379080
and you can do the calculation with "now" like so:

Code: Select all

root@rava:/# seconds2time $(date +%s)-$(date -d "27 Oct 2023 05:58" +%s);echo
2 days 22:40:28
root@rava:/# 
I added the "echo" since seconds2time() is creating a string and produces no new line character to be better used in a script, but for output purposes like the above, a trailing newline makes it prettier.

Cave! date knows nothing about time zone adjustments. In between the given date of "27 Oct 2023 05:58" and "now" my time zone was adjusted from "European summer time" to "European standard time" , meaning it switched from UTC+2 to UTC+1

Meaning for this case:
The result of the above 2 days 22:40:28 is really 2 days 21:40:28 - or it it 2 days 23:40:28? :D

Added in 21 minutes 43 seconds:
Forgot to add: other useful info on date conversions and calculations here:
https://unix.stackexchange.com/question ... 400#738400
https://unix.stackexchange.com/question ... in-a-shell
Cheers!
Yours Rava

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Ravas coding goodies

Post#207 by Rava » 01 Nov 2023, 05:55

And another case of arithmetic, inspired by a post of Rapha_ - Fragmentation of modules on NTFS hard drive (Post by Rapha_ #96880) (Thanks Rapha_!)

Info on top: Rapha_ figured out that from a test-file you can subtract 4 from the output of hdparm --fibmap /path/to/file to get its segments (file fragmentation if there is more than one segment)

I skip the creation of the empty test file, look that up in the other thread that I linked to above, and my article on that (incl. the bash arithmetic) is the one just below Rapha_'s: Fragmentation of modules on NTFS hard drive (Post by Rava #96885)

Complete output of hdparm --fibmap /path/to/file

Code: Select all

root@rava:/mnt/sdb3/test# hdparm  --fibmap tempfile

tempfile:
 filesystem blocksize 4096, begins at LBA 9437184; assuming 512 byte sectors.
 byte_offset  begin_LBA    end_LBA    sectors
           0 1277378560 1277399039      20480
root@rava:/mnt/sdb3/test# 
Only the lines via wc:

Code: Select all

root@rava:/mnt/sdb3/test# hdparm  --fibmap tempfile |wc -l
5
and finally we let the shell do the arithmetic as well:

Code: Select all

root@rava:/mnt/sdb3/test# echo "segments in file: ""$(($(hdparm  --fibmap tempfile |wc -l)-4))"
segments in file: 1
root@rava:/mnt/sdb3/test#
Code-nitpicking on myself: when the segment number is 1, it should say "segment in file: " and when it is > 1 then "segments in file: " (since one segment is not a plural thing) but that would overcomplicate the code for no real sensible reason.

Added in 22 minutes 42 seconds:
Also have this nice tutorial: Bash Math Operations (Bash Arithmetic) Explained :)
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Ravas coding goodies

Post#208 by Ed_P » 01 Nov 2023, 18:53

Rapha_ wrote:
01 Nov 2023, 00:34

Code: Select all

root@porteus:/home/guest# hdparm --fibmap /mnt/sda1/tempfile

/mnt/sda1/tempfile:
filesystem blocksize 4096, begins at LBA 63; assuming 512 byte sectors.
 byte_offset  begin_LBA    end_LBA    sectors
           0   19335879   19336710        832
      425984   19375047   19375614        568
      716800   19564103   19564622        520
      983040   19769223   19769726        504
     1241088   19860799   19861078        280
     1384448   19907191   19907358        168
     1470464   19975255   19975278         24
     1482752   20324535   20324542          8
     1486848   20604703   20605718       1016
     2007040   20658095   20658886        792
     2412544   20866591   20867262        672
     --------  ---------  --------   ----
By counting the rows, you obtain the number of fragments (in this case, remove 4 unnecessary rows from the result) :

Code: Select all

root@porteus:/home/guest# hdparm --fibmap /mnt/sda1/tempfile |wc -l
60
I count 11 fragments.

Code: Select all

1.           0   19335879   19336710        832
2.      425984   19375047   19375614        568
3.      716800   19564103   19564622        520
4.      983040   19769223   19769726        504
5.     1241088   19860799   19861078        280
6.     1384448   19907191   19907358        168
7.     1470464   19975255   19975278         24
8.     1482752   20324535   20324542          8
9.     1486848   20604703   20605718       1016
10.    2007040   20658095   20658886        792
11.    2412544   20866591   20867262        672
Ed

User avatar
Rava
Contributor
Contributor
Posts: 5416
Joined: 11 Jan 2011, 02:46
Distribution: XFCE 5.01 x86_64 + 4.0 i586
Location: Forests of Germany

Ravas coding goodies

Post#209 by Rava » 01 Nov 2023, 19:05

Ed_P wrote:
01 Nov 2023, 18:53
I count 11 fragments.
You are in the wrong thread for that.

Also, I found a fragmented file:

Code: Select all

root@rava:/Porteus_modules# hdparm --fibmap warzone2100-4.1.3-x86_64-1ponce.txz |wc -l
864
And the end of that listing doesn't have the "-------- --------- -------- ----" line at the bottom:

Code: Select all

root@rava:/Porteus_modules# hdparm --fibmap warzone2100-4.1.3-x86_64-1ponce.txz |tail
   322666496  921246528  921246895        368
   322854912  921263608  921264727       1120
   323428352  921386288  921386399        112
   323485696  921378280  921379239        960
   323977216  921289464  921289527         64
   324009984  921527184  921527951        768
   324403200  921628712  921629223        512
   324665344  921586872  921587831        960
   325156864  921673592  921674199        608
   325468160  921529232  921529503        272
One more reason to suspect Rapha_ meant that line as a

Code: Select all

[…]
Still, my bash arithmetic should be accurate:

Code: Select all

root@rava:/Porteus_modules# echo "segments in file: ""$(($(hdparm --fibmap warzone2100-4.1.3-x86_64-1ponce.txz |wc -l)-4))"
segments in file: 860
Cheers!
Yours Rava

User avatar
Ed_P
Contributor
Contributor
Posts: 8374
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

Ravas coding goodies

Post#210 by Ed_P » 01 Nov 2023, 21:49

Rava wrote:
01 Nov 2023, 19:05

Code: Select all

segments in file: 860
I can assure you I don't see 860 segments listed in your:
Rava wrote:
01 Nov 2023, 19:05

Code: Select all

root@rava:/Porteus_modules# hdparm --fibmap warzone2100-4.1.3-x86_64-1ponce.txz |tail
   322666496  921246528  921246895        368
   322854912  921263608  921264727       1120
   323428352  921386288  921386399        112
   323485696  921378280  921379239        960
   323977216  921289464  921289527         64
   324009984  921527184  921527951        768
   324403200  921628712  921629223        512
   324665344  921586872  921587831        960
   325156864  921673592  921674199        608
   325468160  921529232  921529503        272
with or without the "-------- --------- -------- ----" line.
Ed

Post Reply