IF EXIST or FIND with folder names instead of file names?
#26
Posted 31 January 2012 - 03:15 PM
Is it possible to grub4dos command "parttype (hd0,4) 0x00" for a logical partition on a USB flash drive to run?
I've noticed problems with logical partitions.
Please see here:
http://reboot.pro/16274/
For an answer I am grateful.
Regards,
NetFanTom
#27
Posted 31 January 2012 - 03:18 PM
#28
Posted 31 January 2012 - 03:32 PM
partition (hd0,1) is 0x0B primary
partition (hd0,2) is 0x07 primary
If partition (hd0,3) is a extented partition (0x0F)
and
(hd0,4) is a 0x07 logical partition
and i run
parttype (hd0,0) 0x00
parttype (hd0,1) 0x00
parttype (hd0,2) 0x00
parttype (hd0,4) 0x00
the partitioning an the USB Stick is crashed - i have no logical partition and the other partitions are not OK:
If i use only primary partitions then all works fine,
Regards,
#29
Posted 31 January 2012 - 03:43 PM
the partitioning an the USB Stick is crashed - i have no logical partition and the other partitions are not OK:
If i use only primary partitions then all works fine,
What happens if you run:
parttype (hd0,0) 0x00
parttype (hd0,1) 0x00
parttype (hd0,2) 0x00
parttype (hd0,4) 0x00
parttype (hd0,4) 0x07
?
Do you get back (only) the logical partition?
What are the "other partitions? (like hd0,5 - hd0,6, etc.)?
What happens when you do:
parttype (hd0,0) 0x00
parttype (hd0,1) 0x00
parttype (hd0,2) 0x00
parttype (hd0,4) 0x17
?
What happens if you do:
parttype (hd0,0) 0x00
parttype (hd0,1) 0x00
parttype (hd0,2) 0x00
parttype (hd0,4) 0x12
?
WHAT has this to do with IF EXIST/FIND for file or folder?
Wonko
#30
Posted 31 January 2012 - 05:20 PM
WHAT has this to do with IF EXIST/FIND for file or folder?
Answer: nothing
I hope i get the answer here.
If I use parttype (hd0,X) 0x00 for a logical partition, the partion structure will destroyed.
PTEDIT32.exe makes this job properly.
Regards
#31
Posted 31 January 2012 - 05:51 PM
If you could perform the EXACT tests suggested and answer EXACTLY to the other asked questions, maybe it would give you more possibiliies to get an answer (here or somewhere else).Answer: nothing
I hope i get the answer here.
Wonko
#32
Posted 31 January 2012 - 06:29 PM
I need parttype (hd0,4) 0x00.
In the future I need parttype (hd0,4) 0x07 or parttype (hd0,4) 0x0B for logical partitions, but as far as I am not yet come, because the partition structure was destroyed.
(Please see http://reboot.pro/16274/ )
Maybe someone can give me an answer to a simple question.
I say again.
Is it possible to grub4dos command "parttype (hd0,4) 0x00" for a logical partition on a USB flash drive to run?
#33
Posted 31 January 2012 - 06:46 PM
If you execute parttype (hd0,4) 0 and then edit the extended sector and put the 07 ptn type byte back then all is well. You can use the PTEDIT32 EPBR button when on the Extended primary partition to view the Extended ptn table and then just put the byte (07 or 0B) back in the table.
Your question is not so 'simple'. what do you mean by
'to run'- to run what? boot - recognized by Windows, usable with EPT, ????
Can you explain what you are trying to do? In what way is the parttype (hd0,4) command not working properly?
#34
Posted 31 January 2012 - 07:01 PM
Sorry, i don't need parttype (hd0,4) 0x12 or parttype (hd0,4) 0x17 (means that not hide?).
I need parttype (hd0,4) 0x00.
Well, I don't need either, I was only trying to help you, suggesting you a few tests in order to try and understand what the behaviour was, it's your need, not mine.
Wonko
#35
Posted 31 January 2012 - 07:06 PM
The problem is that setting the PTYPE to 17 or 27 does not hide the partition from Windows, so you cannot access any ptn which follows it.Well, I don't need either, I was only trying to help you, suggesting you a few tests in order to try and understand what the behaviour was, it's your need, not mine.
Wonko
e.g. ptn table
17 - Windows shows this ptn only in Explorer
1B
7
17
but if you use
0
B - Windows shows this ptn in Explorer
0
0
So we need to get the ptn to show up in Windows and copy files to it, we need to set the PTYPE to 0 (unless you can think of another way...?).
A further complication is that if you run diskpart on that drive which has 0'd ptn entries, it will erase all the ptn entries from all the PTYPE 0 tables!
#36
Posted 31 January 2012 - 08:43 PM
#if 1 /* disable partition id 00. */ if (((int)pc_slice_no) >= PC_SLICE_MAX - 1 /* if it is a logical partition */ && *next_partition_type == PC_SLICE_TYPE_NONE) /* ignore the partition with id=00. */ goto next_entry; #else /* enable partition id 00. */ #endif
That means, when you set the partition type to 00, grub4dos would simply ignore the existence of the partition, and you cannot access it again in grub4dos.
you may recompile grub4dos(just change "#if 1" to "#if 0" in the above code), and then partition type 00 will be recognized.
Don't set partition type to 00. Many softwares (including some or all of Microsoft's) will function abnormally when type 00 encountered.
#37
Posted 31 January 2012 - 09:06 PM
The problem is that setting the PTYPE to 17 or 27 does not hide the partition from Windows, so you cannot access any ptn which follows it.
e.g. ptn table
17 - Windows shows this ptn only in Explorer
1B
7
17
but if you use
0
B - Windows shows this ptn in Explorer
0
0
So we need to get the ptn to show up in Windows and copy files to it, we need to set the PTYPE to 0 (unless you can think of another way...?).
A further complication is that if you run diskpart on that drive which has 0'd ptn entries, it will erase all the ptn entries from all the PTYPE 0 tables!
How about setting the ID to "0x12 compaq diagnostic" or "0xDE dell utility", or even "Linux" or "Linux swap" ?
#38
Posted 31 January 2012 - 09:18 PM
Yep - Windows likes all of these, 12, DE, 83, FF! It needs to be 0 to be ignored by Windows.How about setting the ID to "0x12 compaq diagnostic" or "0xDE dell utility", or even "Linux" or "Linux swap" ?
#39
Posted 01 February 2012 - 12:59 AM
Yep - Windows likes all of these, 12, DE, 83, FF! It needs to be 0 to be ignored by Windows.
OK, I will suggest chenall enable parttype 00 next time.
#40
Posted 01 February 2012 - 08:57 AM
means:Is it possible to grub4dos command "parttype (hd0,4) 0x00" for a logical partition on a USB flash drive to run?
Is it possible to run the grub4dos command "part type (hd0, 4) 0x00" for a logical partition on a USB stick?
Thanks to Steve6375, he understood me exactly.
Windows will recognize only the parttype 0x00 partition as unused.
If you are renaming 0x07 to 0x17, 0x12, DE, 83, FF, or from
0x01 to 0xFF, then Windows will recognize this as an 0x07 partition anyway.
I know PTEDIT32 doing this job, I need, however, that grub4dos performs this function properly.You can use the PTEDIT32 EPBR button when on the Extended primary partition to view the Extended ptn table and then just put the byte (07 or 0B) back in the table.
@tinybit:
Thanks, that would also allow partitioning of logical partitions on USB flash drives.OK, I will suggest chenall enable parttype 00 next time.
http://reboot.pro/16274/
Best regards,
NetFanTom
#41
Posted 01 February 2012 - 09:41 AM
Why do you need to disable the other partitions anyway? What problems does having them enabled cause?
#42
Posted 01 February 2012 - 10:03 AM
http://code.google.c.../downloads/list
I haven't tested it yet.
#43
Posted 01 February 2012 - 10:14 AM
The previous partitions should not be recognized so that Windows auto mounts the current partition on USB flash drive as a hdd drive (e.g. F:).Why do you need to disable the other partitions anyway? What problems does having them enabled cause?
7 - Windows shows this ptn in Explorer
B
7
7
----------------------------
0
B - Windows shows this ptn in Explorer
7
7
----------------------------
0
0
7 - Windows shows this ptn in Explorer
7
----------------------------
0
0
0
7 - Windows shows this ptn in Explorer
#44
Posted 01 February 2012 - 10:35 AM
#45
Posted 01 February 2012 - 11:48 AM
the Boot order is:
Grub4Dos sequence MBR
grldr (on a not 0x00 Partition)
menu.lst
...
if i take the third partition
e.g. MultiPE
title MultiPE
parttype (hd0,0) 0x00
parttype (hd0,1) 0x00
rootnoverify (hd0,2)
chainloader /bootmgr
MultiPE starts
and auto mounts the third partition as drive with a letter on the USB flash drive.
Regarding
Many Thanks to chenall, tinybit and the others.Chenall has made a new version which recognises parttype 0
I will test it.
#46
Posted 28 February 2012 - 05:21 PM
Lets say, G4D is installed on a USB Thumb with some generic initial menu crafted by a user, or a default menu. When a user needs to add a new image to boot, s/he copies a folder to the Thumb that contains the source image, appropriate G4D menu section, and in some Linux cases a few extracted from the image files. When Grub4DOS is launched, iftitle or similar command scans predefined disks or folders, and if finds a new folder with an image not yet listed in the common Menu, it auto adds corresponding menu section to the common G4D menu thus making it ready to boot? As well, to remove the image, the user just needs to delete the folder, and next launch G4D will remove its section from the common menu.
It will allow more users to get familiar with G4D, since all they would need to do is find or ask on the forum about a G4D menu section that works with their image and possibly what extra files to extract, and the magic of multiboot will show its friendly face. Just a suggestion to think how to make multiboot and G4D more accessible for novices, and some novice developers not familiar with multiboot tools and concepts.
#47
Posted 28 February 2012 - 06:31 PM
I don't get it.Now it appears to search if an ISO is present on disks that is listed in G4D Menu, which is fine.
Right now the iftitle command is "as generic as it can be" nothing actually directly related to .iso:
where command can be any valid grub4dos command and title is a "normal" grub4dos title.iftitle [command] title
If command succeeds then title is displayed, if command fails then title is not displayed.
Is your post connected to this :
http://reboot.pro/16381/page__st__5
Wonko
#48
Posted 28 February 2012 - 06:57 PM
So the user just adds 2 files to his multiboot drive - 1. the payload file (iso or img or ima or whatever) and 2. it's menu.mnu file - e.g. Install Windows 7.mnu, to any folder they liked (same folder as payload file) and it would automatically be listed on boot.
e.g. the final menu that appears to a user would be in memory (bd)/menu.lst and consist of entries like this...
title Install Windows 7
root (bd)/afolder/another
configfile (bd)/afolder/another/Install Windows 7.mnu
Naturally, each mnu file will need to be prepared by someone (?) for each iso or payload file and it must expect to find the payload file at the current root. Does this sound like something you want?
#49
Posted 28 February 2012 - 08:56 PM
As to preparing a .mnu file or section, its a lot easier, because a user would initially have just one or two images in mind, so a forum search or new question in a post would give him the right menu section in most cases. Nice way to try multiboot and G4D, since its advantages aren't obvious for novices, who never tried - some say its just another "favorite pet".
#50
Posted 28 February 2012 - 09:14 PM
Instructions for a user would be:
1. Create a multiboot basic drive following instructions (e.g. use RMPrepUSB to prepare a drive, install grub4dos, add special menu.lst)
2. Download your ISO (or whatever and copy to your drive)
3. Download mnu file and copy it to the same folder
It would be a lot easier to code if all the mnu files were put in the same folder (and therefore also most of the payload files).
Some payloads will need special instructions (like extract folder xyz from the iso and copy it to xyz on the USB drive for some 'special' ISOs that won't boot from an ISO file!)
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users