Linux 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64
x86_64 x86_64 GNU/Linux
May device identifier be changed without reboot?
Thanks
|
|
0
|
|
|
|
Reply
|
alex.vinokur (56)
|
1/5/2012 4:53:24 AM |
|
Alex Vinokur <alex.vinokur@gmail.com> writes:
> Linux 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64
> x86_64 x86_64 GNU/Linux
This is very likely the output of uname -a and it is composed of
multiple pieces of information which can be changed in different ways.
What are you specifically referring to?
|
|
0
|
|
|
|
Reply
|
rweikusat (2680)
|
1/5/2012 4:01:54 PM
|
|
In article <87y5tmm93h.fsf@sapphire.mobileactivedefense.com>,
Rainer Weikusat <rweikusat@mssgmbh.com> wrote:
> Alex Vinokur <alex.vinokur@gmail.com> writes:
> > Linux 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64
> > x86_64 x86_64 GNU/Linux
>
> This is very likely the output of uname -a and it is composed of
> multiple pieces of information which can be changed in different ways.
> What are you specifically referring to?
I don't think he was asking anything about that, just providing the
version of Linux he's using as context. I.e. his question is "In this
version of Linux, can a device ID change between reboots?"
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
|
|
0
|
|
|
|
Reply
|
barmar (5626)
|
1/6/2012 2:24:15 AM
|
|
Alex Vinokur <alex.vinokur@gmail.com> wrote:
>
>May device identifier be changed without reboot?
What do you mean by "device identifier"? That phrase has many different
meanings.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
|
|
0
|
|
|
|
Reply
|
timr (1383)
|
1/6/2012 6:43:35 AM
|
|
On Fri, 2012-01-06, Barry Margolin wrote:
> In article <87y5tmm93h.fsf@sapphire.mobileactivedefense.com>,
> Rainer Weikusat <rweikusat@mssgmbh.com> wrote:
>
>> Alex Vinokur <alex.vinokur@gmail.com> writes:
>> > Linux 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64
>> > x86_64 x86_64 GNU/Linux
>>
>> This is very likely the output of uname -a and it is composed of
>> multiple pieces of information which can be changed in different ways.
>> What are you specifically referring to?
>
> I don't think he was asking anything about that, just providing the
> version of Linux he's using as context. I.e. his question is "In this
> version of Linux, can a device ID change between reboots?"
I think so too. There was a thread here or some other Unix programming
group about such things some weeks ago; possibly you need to find that
one to understand what he's referring to.
Better wait for him to reformulate the question.
/Jorgen
--
// Jorgen Grahn <grahn@ Oo o. . .
\X/ snipabacken.se> O o .
|
|
0
|
|
|
|
Reply
|
nntp24 (1559)
|
1/6/2012 7:02:16 AM
|
|
On Jan 6, 9:02=A0am, Jorgen Grahn <grahn+n...@snipabacken.se> wrote:
> On Fri, 2012-01-06, Barry Margolin wrote:
> > In article <87y5tmm93h....@sapphire.mobileactivedefense.com>,
> > =A0Rainer Weikusat <rweiku...@mssgmbh.com> wrote:
>
> >> Alex Vinokur <alex.vino...@gmail.com> writes:
> >> > Linux 2.6.18-238.12.1.el5 #1 SMP Sat May 7 20:18:50 EDT 2011 x86_64
> >> > x86_64 x86_64 GNU/Linux
>
> >> This is very likely the output of uname -a and it is composed of
> >> multiple pieces of information which can be changed in different ways.
> >> What are you specifically referring to?
>
> > I don't think he was asking anything about that, just providing the
> > version of Linux he's using as context. =A0I.e. his question is "In thi=
s
> > version of Linux, can a device ID change between reboots?"
>
> I think so too. There was a thread here or some other Unix programming
> group about such things some weeks ago; possibly you need to find that
> one to understand what he's referring to.
>
> Better wait for him to reformulate the question.
>
> /Jorgen
>
> --
> =A0 // Jorgen Grahn <grahn@ =A0Oo =A0o. =A0 . =A0 =A0 .
> \X/ =A0 =A0 snipabacken.se> =A0 O =A0o =A0 .
http://groups.google.com/group/comp.unix.programmer/browse_frm/thread/f309d=
300258ad7a1
http://groups.google.com/group/comp.unix.programmer/msg/9dc05598257bdbb6
May 'st.st_dev of the same file (that wasn't removed)' be changed
between reboots?
Alex
|
|
0
|
|
|
|
Reply
|
alex.vinokur (56)
|
1/6/2012 8:14:24 AM
|
|
"Jorgen Grahn" wrote in message
news:slrnjgd73m.1ls.grahn+nntp@frailea.sa.invalid...
[snipped]
> Better wait for him to reformulate the question.
http://groups.google.com/group/comp.unix.programmer/browse_frm/thread/f309d300258ad7a1
http://groups.google.com/group/comp.unix.programmer/msg/9dc05598257bdbb6
May 'st.st_dev of the same file (that wasn't removed)' be changed between
reboots?
Alex
|
|
0
|
|
|
|
Reply
|
alexvn866 (278)
|
1/6/2012 8:21:25 AM
|
|
Alex Vinokur <alex.vinokur@gmail.com> writes:
> May 'st.st_dev of the same file (that wasn't removed)' be changed
> between reboots?
Yes, provided you're prepared to stretch "not removed" a bit.
Suppose the file is on one of several external USB hard disks. Unmount
and detach them all, then re-attach them in a different order. What was
formerly /dev/sdc may now be /dev/sdd, and so on. The st_dev of the
file will differ accordingly.
--
http://www.greenend.org.uk/rjk/
|
|
0
|
|
|
|
Reply
|
rjk (492)
|
1/6/2012 9:22:34 AM
|
|
"Richard Kettlewell" wrote in message
news:87ehvdjicl.fsf@araminta.anjou.terraraq.org.uk...
> Alex Vinokur <alex.vinokur@gmail.com> writes:
>> May 'st.st_dev of the same file (that wasn't removed)' be changed
>> between reboots?
>
> Yes, provided you're prepared to stretch "not removed" a bit.
>
> Suppose the file is on one of several external USB hard disks. Unmount
> and detach them all, then re-attach them in a different order. What was
> formerly /dev/sdc may now be /dev/sdd, and so on. The st_dev of the
> file will differ accordingly.
Thanks.
Does it mean the ftok() function has bug in design on Linux?
-------------------------------------------
From
http://groups.google.com/group/comp.unix.programmer/msg/9dc05598257bdbb6
CentOS glibc-2.5-65.src.rpm source code:
/* sysvipc/ftok.c */
key_t
ftok (pathname, proj_id)
const char *pathname;
int proj_id;
{
struct stat64 st;
key_t key;
if (__xstat64 (_STAT_VER, pathname, &st) < 0)
return (key_t) -1;
key = ((st.st_ino & 0xffff) | ((st.st_dev & 0xff) << 16)
| ((proj_id & 0xff) << 24));
return key;
}
------------------------------------------
==========================================
From http://linux.about.com/library/cmd/blcmdl3_ftok.htm
The resulting value is the same for all pathnames that name the same file,
when the same value of proj_id is used.
==========================================
Alex
|
|
0
|
|
|
|
Reply
|
alexvn866 (278)
|
1/6/2012 9:34:41 AM
|
|
In article <je6f7t$4uv$1@speranza.aioe.org>,
"Alex Vinokur" <alexvn@users.sourceforge.net> wrote:
> "Richard Kettlewell" wrote in message
> news:87ehvdjicl.fsf@araminta.anjou.terraraq.org.uk...
>
> > Alex Vinokur <alex.vinokur@gmail.com> writes:
> >> May 'st.st_dev of the same file (that wasn't removed)' be changed
> >> between reboots?
> >
> > Yes, provided you're prepared to stretch "not removed" a bit.
> >
> > Suppose the file is on one of several external USB hard disks. Unmount
> > and detach them all, then re-attach them in a different order. What was
> > formerly /dev/sdc may now be /dev/sdd, and so on. The st_dev of the
> > file will differ accordingly.
>
>
>
> Thanks.
>
> Does it mean the ftok() function has bug in design on Linux?
.... [code snipped]
>
> ==========================================
> From http://linux.about.com/library/cmd/blcmdl3_ftok.htm
>
> The resulting value is the same for all pathnames that name the same file,
> when the same value of proj_id is used.
> ==========================================
If it's a bug, it may be unavoidable. If the filesystem is unmounted
and re-mounted, how is the OS supposed to know that it's the "same" file?
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
|
|
0
|
|
|
|
Reply
|
barmar (5626)
|
1/6/2012 12:57:48 PM
|
|
Hi,
st.st_dev of the same file (that wasn't deleted) may be changed between
reboots on Linux.
http://groups.google.com/group/comp.unix.programmer/browse_frm/thread/018671b4d364409f
As a result, the ftok() function on Linux may generate different keys for
the same file (that wasn't deleted) between reboots.
It seems to a bug in design of ftok() on Linux.
Does such a problem exist with ftok() on HP-UX?
Alex
|
|
0
|
|
|
|
Reply
|
alexvn866 (278)
|
1/6/2012 2:46:02 PM
|
|
On 2012-01-06, Alex Vinokur <alexvn@users.sourceforge.net> wrote:
> Does it mean the ftok() function has bug in design on Linux?
According to the Single Unix Specification (where the requirement
for ftok comes from: it is not a Linuxism) the ftok function is part of IPC. It
is described as "ftok - generate an IPC key" and declared in the header
<sys/ipc.h>.
IPC objects (shared memory segments, message queues and semaphores) are
volatile; they disappear when the machine is shut down.
In other words, it is not meaningful to try to use a key from a previous
boot of the system to try to find an IPC object.
None of the functions which take a key_t argument such as shmget, msget
and semget, will be able to retrieve anything after a fresh reboot,
no matter what the key_t value is.
I'm afraid that the design of whatever you are writing has a bug (by relying
on ftok to be more/other than an IPC key generator).
|
|
0
|
|
|
|
Reply
|
kaz15 (1129)
|
1/6/2012 4:06:23 PM
|
|
On Jan 6, 6:06=A0pm, Kaz Kylheku <k...@kylheku.com> wrote:
> On 2012-01-06, Alex Vinokur <ale...@users.sourceforge.net> wrote:
>
> > Does it mean the ftok() function has bug in design on Linux?
>
> According to the Single Unix Specification (where the requirement
> for ftok comes from: it is not a Linuxism) the ftok function is part of I=
PC. It
> is described as "ftok - generate an IPC key" and declared in the header
> <sys/ipc.h>.
>
> IPC objects (shared memory segments, message queues and semaphores) are
> volatile; they disappear when the machine is shut down.
>
> In other words, it is not meaningful to try to use a key from a previous
> boot of the system to try to find an IPC object.
>
> None of the functions which take a key_t argument such as shmget, msget
> and semget, will be able to retrieve anything after a fresh reboot,
> no matter what the key_t value is.
>
In the case described be me the keys are from the same reboot, and
they can differ.
> I'm afraid that the design of whatever you are writing has a bug (by rely=
ing
> on ftok to be more/other than an IPC key generator).
|
|
0
|
|
|
|
Reply
|
alex.vinokur (56)
|
1/6/2012 6:17:46 PM
|
|
On Jan 6, 4:46=A0pm, "Alex Vinokur" <ale...@users.sourceforge.net>
wrote:
> Hi,
>
> st.st_dev of the same file (that wasn't deleted) may be changed between
> reboots on Linux.http://groups.google.com/group/comp.unix.programmer/brow=
se_frm/thread...
>
> As a result, the ftok() function on Linux may generate different keys for
> the same file (that wasn't deleted) between reboots.
> It seems to a bug in design of ftok() on Linux.
>
> Does such a problem exist with ftok() on HP-UX?
>
> Alex
See also
http://h30499.www3.hp.com/t5/Languages-and-Scripting/ftok-related-Can-st-st=
-dev-of-the-same-file-be-changed-between/td-p/5441073
|
|
0
|
|
|
|
Reply
|
alex.vinokur (56)
|
1/8/2012 6:55:30 AM
|
|
|
13 Replies
82 Views
(page loaded in 0.202 seconds)
Similiar Articles: Issue: Adding new disk from SAN (EMC) to Solaris 10 OS - comp.sys ...If does not from iostat, you may need to ... How to force recognizing a new device without reboot - comp ... How to scan for new disk in Linux(Redhat) without ... Interface IP address Change. - comp.protocols.time.ntpThis default can be changed with the -U ... I may take a while for some platforms (Windows/Linux - BSD is almost instant as it ... Change IP address without reboot HPUX 11i ... how to stop dhclient from modifying resolv.conf - comp.os.linux ...at the moment they read: > DEVICE=eth1 ... temporarily fix it What you may ... I can not say without going through the scripts. I run Mandriva Linux, a RedHat/fedora ... How to disable outgoing FTP service? - comp.os.vmsYou may also want to test COPY/FTP to ensure that it ... I did not conduct a machine reboot. Will a reboot help? ... ACC=NONE)) BG0: And then granting the IP_ALLOW identifier ... speed of network card - comp.unix.solaris... Ethernet adapter patch (111883) or you may use kstat ce ce_device to ... I am able to set that using ndd command without ... Speed of remote JTAG with Quartus jtagd on linux ... ATAPI CD-ROM drive in a SCSI system - comp.periphs.scsiTekram changed hands several times. I have a feeling they may have been borged ... just for oldies) 3. send a identify-device ... atapi-cd-dma-enabled=1 (and reboot) Without ... svc.startd[7] rpcbind misconfigured - comp.unix.solaris... online 16:15:02 svc:/system/device ... I changed into / root and I reboot with the same wrror messages . ... Please don't blindly change things without ... ntp orphan mode without manycast or multicast or broadcast ...> Is there a way to identify ... Without a restart, you can't ... sntp ... - Unix Linux Forum - Fixunix.com times without requiring a single ... An orphan mesh may be assembled ... Unable to login as oracle user - comp.unix.shell[I filter all Goggle Groups posts, so any reply may be ... Hi, I want that users can login to Oracle 10g without ... agent log ... > > > COMMAND PID USER FD TYPE DEVICE SIZE ... USB as standard debug interface - comp.arch.embedded> > Andreas USB Virtual Com (CDC device), HID ... working, because a COM port number changed. (In many cases without ... install the IDE and start debugging without rebooting ... [OT] Netfinity help ! - comp.sys.ibm.ps2.hardwareWithout special equipment. I have witnesses ... server diagnostic test programs can identify ... F1) ... auto configuration > 10) reboot, PCI error, unsupported PCI device ... sftp (authenticity can't be established) - comp.unix.shell ...... for OpenSSH as provided by Ubuntu; your milage may ... To be able to login without being asked for a password ... root via PuTTY. - comp.unix.solaris ...:q # svcadm restart ... time reset, syncronisation lost and Large PPM values - comp ...... 2600. $uname -a: Linux srv3 2.4.21-9.0.3.ELsmp #1 SMP Mon May 3 13:49 ... for things to stabilize without shutting down ntpd or rebooting ... as can certain other device ... Odd BACKUP error: unsupported file structure ! - comp.os.vms ...I see they changed BACKUP/PHYSICAL to only give a warning ... Anything else that will be missing from a backup without ... be faster because I kept the source to just the device ... fcopy -size limit - comp.lang.tcl... you want want a single transfer, just use fcopy without ... The djmount Linux user-space filesystem driver also ... 16.5GB) via copy & paste & it just does nothing. Rebooting ... Linux Disk Partitioning... type L to list codes): 82 Changed system type of partition 2 to 82 (Linux ... bytes / 512 bytes Disk identifier: 0x00064a1a Device ... A reboot may be required if, for ... Re-read The Partition Table Without Rebooting Linux System... reload the partition change under Linux without rebooting the ... dev/sdX or /dev/hdX with actual device name ... Had to reboot servers. May be to note that I am working on ... 7/16/2012 7:48:18 AM
|