Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Thu 27 Nov 2014, 18:19
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
DriveMan drive manager and AutoDrive auto. mounter.
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 4 of 4 [56 Posts]   Goto page: Previous 1, 2, 3, 4
Author Message
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Thu 22 Apr 2010, 01:21    Post subject:  

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?
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Thu 22 Apr 2010, 02:17    Post subject:  

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.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Thu 22 Apr 2010, 15:23    Post subject:  

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:
                                             ##  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:
# 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...
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Thu 22 Apr 2010, 17:03    Post subject:  

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.
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Thu 22 Apr 2010, 17:21    Post subject:  

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:
 disktype /dev/sddx |egrep '(swap|0x83|Extended|0x0F|0x42)'


Cheers,
s
(Even nicer to have a name - I don't speak xeh very well Very Happy )
Back to top
View user's profile Send private message 
8-bit


Joined: 03 Apr 2007
Posts: 3393
Location: Oregon

PostPosted: Thu 22 Apr 2010, 18:20    Post subject:  

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.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Thu 22 Apr 2010, 18:42    Post subject:  

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.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Thu 22 Apr 2010, 19:54    Post subject:  

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:
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.
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Thu 22 Apr 2010, 20:13    Post subject:  

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.
Back to top
View user's profile Send private message 
seaside

Joined: 11 Apr 2007
Posts: 887

PostPosted: Thu 22 Apr 2010, 21:30    Post subject:  

sunburnt,

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

s
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5042
Location: Arizona, U.S.A.

PostPosted: Thu 22 Apr 2010, 22:54    Post subject:  

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.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 4 of 4 [56 Posts]   Goto page: Previous 1, 2, 3, 4
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0701s ][ Queries: 12 (0.0047s) ][ GZIP on ]