Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!uunet!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!mouse From: mouse@thunder.mcrcim.mcgill.edu (der Mouse) Newsgroups: comp.unix.programmer Subject: Re: backup and restore: what about device files? Message-ID: <1991Jun1.213927.28705@thunder.mcrcim.mcgill.edu> Date: 1 Jun 91 21:39:27 GMT References: <1991May16.233149.15268@athena.mit.edu> Distribution: usa Organization: McGill Research Centre for Intelligent Machines Lines: 29 In article <1991May16.233149.15268@athena.mit.edu>, mlevin@jade.tufts.edu writes: > I would appreciate some advice about the following. When you use a > backup and restore utility on a Unix system, does it backup and > restore device files? That depends on the utility. BSD dump, for example, does; tar does not (in any incarnation I am aware of, at least). Depending on what you are trying to do, sometimes one behavior is appropriate, sometimes the other. > If so, any ideas on how? Is the info given by stat() enough to > recreate the device file (using makenod() or something) for a > restore? Yes. > Any information on getting the attributes of and then re-creating > device files would be reatly appreciated. stat(2) (and lstat(2), if you have it) on a device file will return the device major/minor numbers in the st_rdev element; to recreate it you hand the device number to mknod(2). der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu