View topic - file writing in image
file writing in image
18 posts
• Page 1 of 2 • 1, 2
file writing in image
hi friends i have a requirement to open a file in write mode to write data in qnx image, what my doubt is can we write data in a file in qnx image(i am creating image using mkifs)....
- raohansikarao
- Active Member
- Posts: 34
- Joined: Thu Feb 25, 2010 4:25 am
RE: file writing in image
No you can't.
- mario
- QNX Master
- Posts: 3956
- Joined: Sun Sep 01, 2002 1:04 am
RE: file writing in image
then how can i write data in file(which is open in write mode).........please suggest me
- raohansikarao
- Active Member
- Posts: 34
- Joined: Thu Feb 25, 2010 4:25 am
RE: file writing in image
You need a writable file system. There are many choices depending on your hardware. HD, FLASH, RAMDISK.
- maschoen
- QNX Master
- Posts: 1919
- Joined: Wed Jun 25, 2003 5:18 pm
RE: file writing in image
i am having two different hardwares 1. FLASH 2.HD ......... However first one is main priority, so please tell me how to create writable file system for FLASH and HD
- raohansikarao
- Active Member
- Posts: 34
- Joined: Thu Feb 25, 2010 4:25 am
Re: RE: file writing in image
raohansikarao wrote:i am having two different hardwares 1. FLASH 2.HD ......... However first one is main priority, so please tell me how to create writable file system for FLASH and HD
For a hard drive, start the driver, fdisk the drive device, usually /dev/hd0, then enumerate the drive with mount, dinit the partition, and mount the partition as part of the file system.
- maschoen
- QNX Master
- Posts: 1919
- Joined: Wed Jun 25, 2003 5:18 pm
RE: Re: RE: file writing in image
thank you for your quick reply........still i am unable to solve the issue
what i am doing is
#fdisk/dev/hd0
#mount -e /dev/hd0t78
#dinit -h /dev/hd0t78
#mount -t /dev/hd0t78 /mnt/fs
i dont know where i am doing wrong ......... will you please tell me where it going wrong
what i am doing is
#fdisk/dev/hd0
#mount -e /dev/hd0t78
#dinit -h /dev/hd0t78
#mount -t /dev/hd0t78 /mnt/fs
i dont know where i am doing wrong ......... will you please tell me where it going wrong
- raohansikarao
- Active Member
- Posts: 34
- Joined: Thu Feb 25, 2010 4:25 am
RE: Re: RE: file writing in image
When you fdisk, you need to create a partition. That is not clear from your reply. It is possible to make the partition either in full screen mode, or using command line parameters.
When you enumerate I think you just want to do this:
# mount -e /dev/hd0t78
Then /dev/hd0t78 or whatever partition is on the drive should show up.
If you want to use the -t option for the 2nd mount it should be -t qnx4.
When you enumerate I think you just want to do this:
# mount -e /dev/hd0t78
Then /dev/hd0t78 or whatever partition is on the drive should show up.
If you want to use the -t option for the 2nd mount it should be -t qnx4.
- maschoen
- QNX Master
- Posts: 1919
- Joined: Wed Jun 25, 2003 5:18 pm
RE: Re: RE: file writing in image
I think you need to use mount -e /dev/hd0 to enumerate.
- mario
- QNX Master
- Posts: 3956
- Joined: Sun Sep 01, 2002 1:04 am
RE: Re: RE: file writing in image
Oppse, that is what I meant to say.
- maschoen
- QNX Master
- Posts: 1919
- Joined: Wed Jun 25, 2003 5:18 pm
RE: Re: RE: file writing in image
while i am using 2 nd mount as shown below it is saying that can't mount possible reason is resource is busy
#mount -t qnx4 /dev/hd0t78 /fs/
#mount -t qnx4 /dev/hd0t78 /fs/
- raohansikarao
- Active Member
- Posts: 34
- Joined: Thu Feb 25, 2010 4:25 am
RE: Re: RE: file writing in image
I think it means that /fs/ is busy. Try something like /fs/q4.
- maschoen
- QNX Master
- Posts: 1919
- Joined: Wed Jun 25, 2003 5:18 pm
RE: Re: RE: file writing in image
thank you for your quick responses .... now i am explain you what i am doing clearly in OS and imge so that i will get solution quickly
1. i am creating a disk partition using <fdisk /dev/hd0 >command and create a partition hd0t78
2. then i enumerating the HD as <mount -e /dev/hd0>
3. after that i am doing <dinit -h /dev/hd0t78>
4.after that again i am mounting the hd0t78 as
<mount -t qnx4 /dev/hd0t78 /fs/>
5.after restarting the system i see a drive hd0-qnx4-2 in /fs/ path and i copying my ifs image in /fs/hd0-qnx4-2/.boot file
6.here what i am doing in image build file is i am starting devb-eide as
<devb-eide blk auto=partition dos exe=all cam quite>
<waitfor /dev/hd0>
what my requirement is i have a executable file in image which is named "file", on executing this my name i.e hansikarao will add to a file named "hansikarao" both are in root path only
in image i am doing as shown below
#cd root
#./file
#cat hansikarao
but nothing is added to that file.
i think you people understood my requirement clearly now.please suggest me where i am doing wrong.thanks in advance
1. i am creating a disk partition using <fdisk /dev/hd0 >command and create a partition hd0t78
2. then i enumerating the HD as <mount -e /dev/hd0>
3. after that i am doing <dinit -h /dev/hd0t78>
4.after that again i am mounting the hd0t78 as
<mount -t qnx4 /dev/hd0t78 /fs/>
5.after restarting the system i see a drive hd0-qnx4-2 in /fs/ path and i copying my ifs image in /fs/hd0-qnx4-2/.boot file
6.here what i am doing in image build file is i am starting devb-eide as
<devb-eide blk auto=partition dos exe=all cam quite>
<waitfor /dev/hd0>
what my requirement is i have a executable file in image which is named "file", on executing this my name i.e hansikarao will add to a file named "hansikarao" both are in root path only
in image i am doing as shown below
#cd root
#./file
#cat hansikarao
but nothing is added to that file.
i think you people understood my requirement clearly now.please suggest me where i am doing wrong.thanks in advance
- raohansikarao
- Active Member
- Posts: 34
- Joined: Thu Feb 25, 2010 4:25 am
RE: Re: RE: file writing in image
It is not at all clear to me what you are doing wrong. Does the program "./file" run? Do you have an evidence that it does? Does it give you feedback, eg. "File hansikarao has been created"? Maybe you should post the source to "./file".
- maschoen
- QNX Master
- Posts: 1919
- Joined: Wed Jun 25, 2003 5:18 pm
My personal guess is that raohansikarao has not actually put anything on his newly formatted drive.
In other words:
In these 2 steps the only thing that appears to be written to the newly formatted drive is a .boot file.
At no time was a /root directory created, nor was an executable called file copied to the /root directory etc.
Formatting and initializing a drive doesn't copy any files to it.
Tim
In other words:
5.after restarting the system i see a drive hd0-qnx4-2 in /fs/ path and i copying my ifs image in /fs/hd0-qnx4-2/.boot file
6.here what i am doing in image build file is i am starting devb-eide as
<devb-eide blk auto=partition dos exe=all cam quite>
<waitfor /dev/hd0>
In these 2 steps the only thing that appears to be written to the newly formatted drive is a .boot file.
At no time was a /root directory created, nor was an executable called file copied to the /root directory etc.
Formatting and initializing a drive doesn't copy any files to it.
Tim
- Tim
- Senior Member
- Posts: 1049
- Joined: Wed Mar 10, 2004 12:28 am
18 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 0 guests
