Lines Matching defs:dev
70 // TODO detect existing identical mount (procfs with different dev name?)
83 // TODO what if you --bind mount a block device somewhere (file, dir, dev)
101 {"nodev", MS_NODEV}, {"dev", ~MS_NODEV},
167 static void mount_filesystem(char *dev, char *dir, char *type,
179 error_msg("'%s' not user mountable in fstab", dev);
185 if (strstart(&dev, "UUID=")) {
186 char *s = tortoise(0, (char *[]){"blkid", "-U", dev, 0});
188 if (!s) return error_msg("No uuid %s", dev);
189 dev = s;
201 if (!stat(dev, &stdev) && !stat(dir, &stdir)
209 toys.exitval |= xrun((char *[]){"swapon", "--", dev, 0});
219 error_msg("%s: need -t", dev);
236 printf("try '%s' type '%s' on '%s'\n", dev, type, dir);
238 rc = mount(dev, dir, type, flags, opts);
246 printf("trying BLKROSET ioctl on '%s'\n", dev);
247 if (-1 != (fd = open(dev, O_RDONLY))) {
253 fprintf(stderr, "'%s' is read-only\n", dev);
270 dev = tortoise(1, (char *[]){"losetup",
271 (flags&MS_RDONLY) ? "-fsr" : "-fs", dev, 0});
272 if (!dev) break;
281 perror_msg("'%s'->'%s'", dev, dir);
290 char *opts = 0, *dev = 0, *dir = 0, **ss;
314 else if (!dev) dev = sss;
333 if (FLAG(a) || (dev && (!dir || getuid() || remount))) {
348 if (dev) {
349 len = strlen(dev);
350 if (strncmp(dev, mm->dir, len)
357 if (dev && strcmp(dev, mm->device) && (dir || strcmp(dev, mm->dir)))
361 // Don't overmount the same dev on the same directory
385 error_exit("'%s' not in %s", dir ? dir : dev,
389 } else if (!dev) {
405 mount_filesystem(dev, dir, TT.type, flags, more);