Hi Ernest,

Ernest jw ter Kuile wrote:
On Thursday 28 September 2006 02:32, Paul Sokolovsky wrote:
Hello Ernest,

Thursday, September 28, 2006, 12:13:17 AM, you wrote:

Oops bug Synthesizing the initial hotplug events
hda: SAMSUNG  CF/ATA, CFA DISK drive
ide0 at 0xc4820000-0xc4820007,0xc482000e on irq 92
hda: max request size 128KiB
hda: 2041200 sectors (1045 MB)  w/0KiB Cache, CHS=2025/16/63
 hda: hda1 <hda5 hda6 hda7 >
ide-cs: hda: Vcc = 3.3, Vpp = 0.0
Waiting for /dev ...
ending with your :
ERROR: PARTITIONLESS CARD etc...

Just for information this is all still true when using 449.

hmmm


This is the output from parted on the desktop using same CF:

GNU Parted 1.7.1
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print

Disk /dev/sda: 1045MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

⭿⭿er  Start   End     Size    File system  Flags
 1      0.00kB  1045MB  1045MB  fat32


But parted can read the disk if given /dev/sda5 ! output then:

(parted) select /dev/sda5
Using /dev/sda5
(parted) print

Disk /dev/sda5: 31.9MB
Sector size (logical/physical): 512B/512B
Partition Table: loop

⭿⭿er  Start   End     Size    File system  Flags
 1      0.00kB  31.9MB  31.9MB  fat16


I used cfdisk to partition the CF. As far as I know it is quite capable of doing the job, and is pretty standard within Linux

Using parted check to verify the CF I get all kind of warnings that Windows will not like my partitions (as if I cared). Yet Windows 2k doesn't seem to have any troubles reading the partition table.

Which warnings?


Conclusion: information from parted is suspect. After this I would recommend dumping parted.

Dump parted from what?
RR?
No, not happening, no alternative, does the job, does it well, is small,
and is in Familiar build tree. Do I need any more reasons? ;)


Note: I can imagine this happens because this CF used to be formatted without partition table. Still, I would expect parted to be able to see the partitions since all other programs I tryed see them the same way.

Try using fdisk. it simple, older than dirt, solid like a rock.
parameters -l will only list the requested partition table and exit,
and is relatively easy to use within a script.

Relative to parted?


terkuile:/home/ernest# fdisk /dev/sda -l

Disk /dev/sda: 1045 MB, 1045094400 bytes
33 heads, 61 sectors/track, 1014 cylinders
Units = cylinders of 2013 * 512 = 1030656 bytes

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1        1014     1020560+   5  Extended
/dev/sda5               1          31       31140+   4  FAT16 <32M
/dev/sda6              32         953      927962+  83  Linux
/dev/sda7             954        1014       61366   82  Linux swap / Solaris

and when done on a partitionless CF using mkfs -I -t vfat /dev/sda

terkuile:/home/ernest# fdisk -l /dev/sda

Disk /dev/sda: 1045 MB, 1045094400 bytes
33 heads, 61 sectors/track, 1014 cylinders
Units = cylinders of 2013 * 512 = 1030656 bytes

   Device Boot      Start         End      Blocks   Id  System


The above should be quite parsable for shell wizards like you.


Flattery will get you nowhere ;)


  if (parted -s $crd print|grep "^Disk label"|grep "loop" > /dev/null); then


check_partitionless_card ()
{
    local crd
    detect_cards cardsl

    for crd in $cardsl; do
        if (parted -s $crd print|grep "^Disk label"|grep "loop" > /dev/null); 
then
            message "=============================================="
            message "ERROR: PARTITIONLESS CARD FOUND ON $crd"
            message "RAMDISK RESCUE WILL NOT BE ABLE TO INSTALL LINUX TO SUCH "
            message "CARD, AS IT IS NOT POSSIBLE TO CREATE ADDITIONAL EXT2 "
            message "PARTITION ON IT."
            message "PLEASE REFORMAT YOUR CARD WITH PARTITION TABLE INCLUDED."
            message "WINDOWS SYSTEM IN PARTICULAR KNOWN TO FORMAT MOST 
REMOVABLE"
            message "STORAGE DEVICES PARTITIONLESS. PLEASE USE LINUX SYSTEM"
            message "(E.G. LIVECD) OR MOST DIGITAL CAMERAS TO PRODUCE SUITABLE"
            message "PARTITIONING."
            message "CANNOT CONTINUE"
            exit 1
        fi
    done
}

As I look at it now, the only problem I can see is that Paul has missed a "$"
before the first brace.
PAUL!!!! :))

and I suppose the grep statement could be cleaned up :)
oh, and final grep should probably be grep -q
and 2>/dev/null


However, I doubt that fdisk would make that look or function any better
(once fixed).
I've avoided using fdisk when possible in RR as it's provided as an
extra for users who don't need the extra capabilities of parted.
(Should they have console access to the RR handheld).
ie. fdisk is an optional extra which I might remove at any time :)
parted does all that fdisk does and vastly more.


I must be using a different parted as there never seem to be a "^Disk label"
in its output. Even for my desktop's HDs /dev/hda and /dev/hdd

On my workstation:
venice:~# parted -v
GNU Parted 1.6.25.1
# parted -s /dev/sde print | grep loop
Disk label type: loop

On h2200 with RR (with the same card)
[EMAIL PROTECTED]:~# parted -v
GNU Parted 1.6.23
[EMAIL PROTECTED]:~# parted -s /dev/mmcblk0 print | grep loop
Disk label type: loop



I initially had absolutely no interest in supporting the conversion
of cards without partition tables. I am not aware of any manufacturer
who sells cards even blank, let alone formatted with a filesystem
and without a partition table. I am also not aware of any portable
device, be it a handheld, camera, etc, that will format a card
without partitioning it. So my understanding was that it was only
users who either believed they were being clever by doing such a
thing (the theory being that you gain a small amount of space),
or who were ignorant of what I consider to be a standard.

However, once Paul put the partionless check into RR, my interest
piqued, and I have been testing a method to convert a card from
raw (partionless) to partitioned without data loss. It is proving
to be difficult, but should be possible. Preliminary tests indicate
no data loss so far using the technique I've implemented, however
there is a LONG way to go. There is absolutely no way that the
code will be ready for the 0.6.4 release, and depending on how
long I can maintain interest in the idea, how long test card holds
out (I'm punishing it;), etc, certainly won't be happening any time
soon.

If there were more users who insist on using "partionless" cards,
_AND_ I had a few more small test cards (eg. 16MB SD/MMC are ideal)
I could be tempted to continue to work on this, as a side project.



Marcus.
_______________________________________________
Hx4700-port mailing list
[email protected]
https://www.handhelds.org/mailman/listinfo/hx4700-port

Reply via email to