LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-08-2009, 02:23 PM   #1
chethanzmail
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Rep: Reputation: 0
Question Installing packages to a mounted filesystem


I have mounted a root filesystem (debian 4.0) to /mnt/new-image/.

I am trying to understand if I can install new software/packages to this root filesystem mounted at this location (/mnt/new-image). If I am allowed to do this, how/where do I specify the installation path so that the installed files are in the mounted partition itself?

Also, when I unmount this image after installing additional packages, I am assuming that the changes are automatically saved to the original image. Hopefully this is the way it works Please advise on this.

BTW, The host system is running Debian too.

Your suggestions are much appreciated.

Thanks,
Chethan
 
Old 10-08-2009, 02:26 PM   #2
NightHorse
Member
 
Registered: Jun 2009
Location: Egypt
Distribution: Ubuntu 10.04
Posts: 117

Rep: Reputation: 16
You can chroot into the mounted file system like this "chroot /mnt/new-image"
After chrooting you are actually working on the mounted file system on that terminal. If you do apt-get install *packagename* you are installing it into the mounted file system.
 
Old 10-08-2009, 02:28 PM   #3
pljvaldez
LQ Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Wheezy (x86)
Posts: 6,094

Rep: Reputation: 271Reputation: 271Reputation: 271
I haven't tried this, but I think you can just chroot /mnt/new-image and then from there install packages using aptitude. chroot changes the root environment to the mount point (at least this is how it works when fixing a grub installation).
 
Old 10-08-2009, 02:32 PM   #4
chethanzmail
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for the quick reply

Thanks a tonne!

Are the packages I install automatically saved when I umount the image? Is this taken care of by the -o loop option that is used along with the mount command?

Thanks,
Chethan
 
Old 10-08-2009, 02:50 PM   #5
NightHorse
Member
 
Registered: Jun 2009
Location: Egypt
Distribution: Ubuntu 10.04
Posts: 117

Rep: Reputation: 16
Why are you using -o loop??? Is it an iso image???

If it was just a hard disk partition then it's saved. but if so I don't know why are you using -o loop with it??
 
Old 10-08-2009, 03:10 PM   #6
chethanzmail
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Original Poster
Rep: Reputation: 0
No, it is not an ISO image. It is just seen as a "file" on a different location in the hard disk.

I am using the -o loop to apparently "loop mount" the file. Pardon me, but I am not sure how -o loop helps here either.
 
Old 10-09-2009, 12:24 AM   #7
NightHorse
Member
 
Registered: Jun 2009
Location: Egypt
Distribution: Ubuntu 10.04
Posts: 117

Rep: Reputation: 16
I never tried -o loop with anything but iso images. Anyway as long as you have the file system mounted you can chroot to it work like you are working on that system. It's very useful when you are testing software. Install whatever you want or modify whatever you want then exit and it all saved.
 
Old 10-09-2009, 07:46 AM   #8
chethanzmail
LQ Newbie
 
Registered: Oct 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks for your replies. Has worked for me without issues!

Chethan
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
question on mounted filesystem xiaozheyu AIX 3 11-27-2006 03:33 PM
Filesystem mounted as read-only? Why? How? Misfit138 Linux - Newbie 6 11-27-2006 07:27 AM
mounted filesystem error.... Basslord1124 Linux - General 4 03-17-2005 02:29 PM
Filesystem Mounted Improperly? Bigun Linux - Software 11 09-21-2003 02:11 PM
e2fsck on a mounted filesystem glock19 Linux - General 2 07-09-2003 08:12 PM


All times are GMT -5. The time now is 06:58 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration