Sponsored Content
Operating Systems Linux C++ Code to Access Linux Hard Disk Sectors (with a LoopBack Virtual Hard Disk) Post 302490912 by dsw on Wednesday 26th of January 2011 06:00:24 AM
Old 01-26-2011
Check the perms on /dev/loop0

Code:
ls -l /dev/loop0

This User Gave Thanks to dsw For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

hard disk problems

Hi all I am facing a strange problem. I am using a sun ultra10 spark machine. first i took a 20gb IDE hard disk and installed solaris 5.8. But due to some requirement i have to reinstall the OS but this time solaris 2.6. and now the hard disk capacity is only showing 8gb. Where the 12gb... (3 Replies)
Discussion started by: Prafulla
3 Replies

2. Filesystems, Disks and Memory

hard disk meltdown

I had an issue with a second hard disk in my machine. I have a sparc station running solaris 7. It was working fine but now it wont mount on boot up and when you try to mount it manually it gives an I/O error. I tried a different disk as a control which was fine. What I want to know is if my... (3 Replies)
Discussion started by: Henrik
3 Replies

3. Filesystems, Disks and Memory

Adding hard Disk

Hi all, I am using SCO Openserver V and I want to add one more harddisk (/dev/hd1) Hw can I do it? (1 Reply)
Discussion started by: skant
1 Replies

4. UNIX Desktop Questions & Answers

Hard Disk

I have a cuestion. How Can I to add other hard disk to my computer? I need to configurate anyone? (4 Replies)
Discussion started by: hmaraver
4 Replies

5. UNIX for Dummies Questions & Answers

Hard Disk Check

How can we check the number of hard disks (both internal & external) in a server, their capacity and serial number (5 Replies)
Discussion started by: muneebr
5 Replies

6. UNIX for Dummies Questions & Answers

Hard Disk at 99% Help!

:eek: I use this Solaris to run CMS a call acounting software package for my job. No one could run reports today because it said the this when you logged on "The following file systems are low, and could adversely affect server performance: File system /: 99%full" Can some one please explain... (9 Replies)
Discussion started by: mannyisme
9 Replies

7. UNIX for Dummies Questions & Answers

How to increase hard disk in linux

Hi guys i have created a linux machine in virtual box now i want to add some hard disk space into it. How would i do this. Please help. Machine details are as below # lsb_release -a LSB Version: :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch Distributor ID:... (7 Replies)
Discussion started by: pinga123
7 Replies

8. SCO

declare disk driver for IDE hard disk

hi I've a fresh installation of SCO 5.0.7 on the IDE hard disk. For SCSI hard disk I can declare, for example blc disk driver using: # mkdev hd 0 SCSI-0 0 blc 0but it works for IDE hard disk? (3 Replies)
Discussion started by: ccc
3 Replies

9. Red Hat

Need help for getting hard-disk traces

When we write a programme,we declare variables and compiler allocates memory to them.I want to get access to the physical block number of hard-disk where actually the data is stored by the programme " Some one help me out... (1 Reply)
Discussion started by: nagraz007
1 Replies

10. UNIX for Advanced & Expert Users

Need help for getting hard-disk traces

When we write a programme,we declare variables and compiler allocates memory to them.I want to get access to the physical block number of hard-disk where actually the data is stored by the programme " Some one help me out... (3 Replies)
Discussion started by: nagraz007
3 Replies
LOSETUP(8)						       System Administration							LOSETUP(8)

NAME
losetup - set up and control loop devices SYNOPSIS
Get info: losetup [loopdev] losetup -l [-a] losetup -j file [-o offset] Detach a loop device: losetup -d loopdev... Detach all associated loop devices: losetup -D Set up a loop device: losetup [-o offset] [--sizelimit size] [--sector-size size] [-Pr] [--show] -f|loopdev file Resize a loop device: losetup -c loopdev DESCRIPTION
losetup is used to associate loop devices with regular files or block devices, to detach loop devices, and to query the status of a loop device. If only the loopdev argument is given, the status of the corresponding loop device is shown. If no option is given, all loop devices are shown. Note that the old output format (i.e., losetup -a) with comma-delimited strings is deprecated in favour of the --list output format. It's possible to create more independent loop devices for the same backing file. This setup may be dangerous, can cause data loss, corrup- tion and overwrites. Use --nooverlap with --find during setup to avoid this problem. OPTIONS
The size and offset arguments may be followed by the multiplicative suffixes KiB (=1024), MiB (=1024*1024), and so on for GiB, TiB, PiB, EiB, ZiB and YiB (the "iB" is optional, e.g., "K" has the same meaning as "KiB") or the suffixes KB (=1000), MB (=1000*1000), and so on for GB, TB, PB, EB, ZB and YB. -a, --all Show the status of all loop devices. Note that not all information is accessible for non-root users. See also --list. The old output format (as printed without --list) is deprecated. -d, --detach loopdev... Detach the file or device associated with the specified loop device(s). Note that since Linux v3.7 kernel uses "lazy device destruc- tion". The detach operation does not return EBUSY error anymore if device is actively used by system, but it is marked by autoclear flag and destroyed later. -D, --detach-all Detach all associated loop devices. -f, --find [file] Find the first unused loop device. If a file argument is present, use the found device as loop device. Otherwise, just print its name. --show Display the name of the assigned loop device if the -f option and a file argument are present. -L, --nooverlap Check for conflicts between loop devices to avoid situation when the same backing file is shared between more loop devices. If the file is already used by another device then re-use the device rather than a new one. The option makes sense only with --find. -j, --associated file [-o offset] Show the status of all loop devices associated with the given file. -o, --offset offset The data start is moved offset bytes into the specified file or device. --sizelimit size The data end is set to no more than size bytes after the data start. -b, --sector-size size Set the logical sector size of the loop device in bytes (since Linux 4.14). The option may be used when create a new loop device as well as stand-alone command to modify sector size of the already existing loop device. -c, --set-capacity loopdev Force the loop driver to reread the size of the file associated with the specified loop device. -P, --partscan Force the kernel to scan the partition table on a newly created loop device. -r, --read-only Set up a read-only loop device. --direct-io[=on|off] Enable or disable direct I/O for the backing file. The optional argument can be either on or off. If the argument is omitted, it defaults to on. -v, --verbose Verbose mode. -l, --list If a loop device or the -a option is specified, print the default columns for either the specified loop device or all loop devices; the default is to print info about all devices. See also --output, --noheadings, --raw, and --json. -O, --output column[,column]... Specify the columns that are to be printed for the --list output. Use --help to get a list of all supported columns. -n, --noheadings Don't print headings for --list output format. --raw Use the raw --list output format. -J, --json Use JSON format for --list output. -V, --version Display version information and exit. -h, --help Display help text and exit. ENCRYPTION
Cryptoloop is no longer supported in favor of dm-crypt. For more details see cryptsetup(8). RETURN VALUE
losetup returns 0 on success, nonzero on failure. When losetup displays the status of a loop device, it returns 1 if the device is not configured and 2 if an error occurred which prevented determining the status of the device. FILES
/dev/loop[0..N] loop block devices /dev/loop-control loop control device EXAMPLE
The following commands can be used as an example of using the loop device. # dd if=/dev/zero of=~/file.img bs=1024k count=10 # losetup --find --show ~/file.img /dev/loop0 # mkfs -t ext2 /dev/loop0 # mount /dev/loop0 /mnt ... # umount /dev/loop0 # losetup --detach /dev/loop0 ENVIRONMENT
LOOPDEV_DEBUG=all enables debug output. AUTHORS
Karel Zak <kzak@redhat.com>, based on the original version from Theodore Ts'o <tytso@athena.mit.edu> AVAILABILITY
The losetup command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/. util-linux November 2015 LOSETUP(8)
All times are GMT -4. The time now is 04:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy