LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
LinkBack Search this Thread
Old 05-04-2005, 03:30 PM   #1
zero79
Member
 
Registered: Nov 2003
Location: Ohio
Distribution: Debian Unstable
Posts: 460

Rep: Reputation: 30
Question mounting a hard disk image as user?


Hi,

I am unable to mount a hard disk image via the loop device as user; however, I am able to mount the image as root. It would make my life significantly simpler to be able to mount and unmount this image as a standard user.

i can mount the image as root with:

Code:
$ lsmod | grep loop
loop                   16424  0
$mkdir /home/account/mnt
$ su -c "mount -o loop=/dev/loop0 /home/account/test.img /home/account/mnt"
$ su -c "ls /home/account/mnt"
test1 test2
$ su -c "umount /home/account/mnt"
now if i attempt to perform the same operations as user, i get errors:

Code:
$ mount -o loop=/dev/loop0 /home/account/test.img /home/account/mnt
/dev/loop1: Permission denied
i figured there may be an issue with permissions:

Code:
$ ls -l /dev/loop0
brw-rw----  1 root disk 7, 1 2005-05-03 11:24 /dev/loop0
$ chmod 666 /dev/loop0
$ ls -l /dev/loop0
brw-rw-rw-  1 root disk 7, 1 2005-05-03 11:24 /dev/loop0
now, i have a new error, but i don't know exactly what this means:

Code:
$ mount -o loop=/dev/loop0 /home/account/test.img /home/account/mnt
memlock: Operation not permitted
Couldn't lock into memory, exiting.
thanks for any thoughts or assistance...this is really bugging me.

Last edited by zero79; 05-04-2005 at 03:31 PM.
 
Old 05-04-2005, 04:01 PM   #2
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 52
You need to modify /etc/fstab so users can mount it. There's an example here: http://www.linuxsecurity.com/docs/HO...n-HOWTO-4.html
 
Old 05-05-2005, 08:12 PM   #3
jschiwal
Moderator
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 14,972

Rep: Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528
I think that I would make an entry in the fstab and use the options:
noauto,uid=account,gid=account

or you could use the options
noauto, user

When mounting it as a user, use the mount location and not the device location:
mount /home/account/mnt

Also, this is assuming that your user name is 'account' or that you have read and execute permissions for the /home/account directory.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Boot ISO image from hard disk? AlexV Linux - General 8 02-20-2009 08:34 AM
Mounting a qemu created root disk image Valhalla Linux - Software 4 10-26-2005 09:34 PM
problem mounting a disk image zero79 Debian 2 05-03-2005 03:15 PM
hard disk image nived Linux - Software 3 12-08-2004 10:05 AM
What is the best sofware to backup an image of a hard disk of any OS? rooch84 Linux - Software 7 08-09-2004 04:28 AM


All times are GMT -5. The time now is 12:40 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration