Page 3 of 3

Posted: Thu 22 Apr 2010, 05:21
by 8-bit
I just plugged in an external USB hard drive with 2 partitions; one ext2 and a swap partition.
DM showed the swap partition in it;s list of drives/partitions.
I think this goes along with DM showing the mounted Puppy filesystem as a drive with a blank name.
Is there any way for driveman to check partition/drive type and not display a swap partition or for that matter, the mounted Puppy file system as a drive/partition?

Posted: Thu 22 Apr 2010, 06:17
by 8-bit
Being a glutton for punishment, I just tried adding driveman to .jwmrc-tray.

I used the same line that the popup keyboard line used except for replacing xvkbd with driveman in the line.
When I restarted JWM, driveman popped up.
But since there is no code in it to hide it if it is not being used, it stayed up.
But the interesting part was that the line started it.

Learn by experimenting.

Posted: Thu 22 Apr 2010, 19:23
by sunburnt
No, the empty ROX filer is due to it unmounting the drive and running ROX. Fixed...
Run ROX on an unused dir. like /mnt/data, it`ll be empty because the dir. is empty.

But this line in DriveMan is supposed to filter out the extended and swap partitions:

Code: Select all

															##  L.s    L.x    L.x    95x   NTx  ###
[ "`disktype /dev/$DEV | egrep '(0x82|0x83|0x05|0x0F|0x42)'`" ]&& continue
Could you run this command on your swap to see what your swap is reported as:
disktype (swap partition)
disktype /dev/sda4 .......... ( Example )
The output looks like this:

Code: Select all

# disktype /dev/sda3

--- /dev/sda3
Block device, size 21.05 GiB (22603069440 bytes)
Swap file
  Volume size 1.05 GiB (22603067392 bytes, 5518327 blocks of 4 KiB)[.code]
  Type 0x82 (Linux Swap)
Yours will look a little different from what I posted here... ( I don`t use a swap )
Could you post the output for me? It should be: " Type 0x82 " , but we`ll see...

Posted: Thu 22 Apr 2010, 21:03
by 8-bit
Ask and you shall receive.
Although hotpup does not show the swap partition, driveman does.
Hotpup on my PC only shows an icon for sde1.
Driveman shows one for sde1 and sde2.

And as to the requested information, here it is:

# disktype /dev/sde2

--- /dev/sde2
Block device, size 1.004 GiB (1077511680 bytes)
Linux swap, version 2, subversion 1, 4 KiB pages, little-endian
Swap size 1.004 GiB (1077501952 bytes, 263062 pages of 4 KiB)

#

It looks to me like disktype is not returning any "Type xxxx " information.
So your checks fail.

Posted: Thu 22 Apr 2010, 21:21
by seaside
Yes, disktype /dev/xxx apparently doesn't always return the hex id for swap and extended.

It always returns text id so this should work-

Code: Select all

 disktype /dev/sddx |egrep '(swap|0x83|Extended|0x0F|0x42)'
Cheers,
s
(Even nicer to have a name - I don't speak xeh very well :D )

Posted: Thu 22 Apr 2010, 22:20
by 8-bit
That change took care of excluding swap partitions from the DM display.
I still am trying to figure out what the blank one that shows being mounted is.
OH!! Just maybe it could be my printer's sd card slot. It is empty though I have seen it reported in Systeminfo as a storage device with no
card in it.

Posted: Thu 22 Apr 2010, 22:42
by sunburnt
As I recall MU was telling me a few years back that fdisk is much faster than disktype.
What ever happened to my old buddy Mark? ( He lives in the German Puppy forum I guess...)

I`m looking at using fdisk instead of /proc/partitions and disktype to get the drive list.
I`ve got it working in DriveMan, but I need to change AutoDrive also. I`ll post it later.

This is another perfect example of the need for libraries, this is a commonly needed function.

Posted: Thu 22 Apr 2010, 23:54
by sunburnt
seaside; It doesn`t return text consistently, that`s probably why you have "x082" and "x042".
This makes it somewhat unreliable for partition info ( Linux needs new exec. utilities! ).
The fdisk line is longer but it seems to be more reliable. They certainly make it a mess. huh?
This line is for AutoDrive to test for extended and swap partitions:

Code: Select all

fdisk -l |sed 's/*//;/./!d' |egrep -v '(bytes|heads|End)' |awk '{print $5}' |egrep '(82|42|5|f)'
DriveMan has to do it a little differently, but it eliminates running disktype for each partition.
Now all it does in each loop is echo a string to test for extended and swap partitions. Better...
I think it starts noticeably quicker as it only reads the drives once instead of for each partition.

Posted: Fri 23 Apr 2010, 00:13
by sunburnt
8-bit; AutoDrive does card readers but they are a real mixed bag, I don`t have one so...
If you unplug your printer and restart DriveMan, do you still have a blank entry?
Maybe we can eliminate it from showing in the drive list if you can nail it down.

My friends HP lappy has a card reader and AutoDrive works wonderfully with it.
Plug a card in and it mounts and pops ROX up, pull it out and bingo it gone!
Many external card readers don`t work that way, the reader is what`s recognized, not the card.

Posted: Fri 23 Apr 2010, 01:30
by seaside
sunburnt,

Maybe command "blkid". It returns all text and won't include "Extended" partitions but does list swap ones.

s

Posted: Fri 23 Apr 2010, 02:54
by sunburnt
Thanks seaside; I looked at blkid years ago working on AutoDrive but didn`t care for it.
I just ran it and it listed my drives and also listed the next complete set of devices 1-12 !!!
" fdisk -l " seems to be the best the best way to get device info as MU said.