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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
05-22-2012, 08:17 PM
|
#1
|
LQ Newbie
Registered: May 2012
Posts: 5
Rep:
|
Dumb question. Copy files from iso9660 partition, destination bigger than source?
Hello there!
I'm new to Linux and i have a dumb question.
I have a partition /dev/sda2 type iso9660 and so accessible only in RO mode.
I tried to copy all files from that partition to another rw partition, /dev/sdb1 (USB pendrive)
I noticed that the size of whole sda2 partition is almost 170mb (seen by df -h command) and when i try to copy it, the destination directory is about twice its original size!! How's that possible? I copied it without symlinks ( cp --no-dereference -rvp was the command i used)
I tried also doing a TAR file (TAR doesn't follow symlinks) but the result is the same!
Anyone can tell me why it's happening?
Thanks a lot!! This forum is very helpful! I found many other useful topics for other problems!
|
|
|
05-23-2012, 04:46 AM
|
#2
|
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099
|
Hi there,
Quote:
Originally Posted by simonspt
I have a partition /dev/sda2 type iso9660 and so accessible only in RO mode.
I tried to copy all files from that partition to another rw partition, /dev/sdb1 (USB pendrive)
|
what file system do you have on the USB drive? - Possibly doesn't matter, but I notice you didn't give that information.
Quote:
Originally Posted by simonspt
I noticed that the size of whole sda2 partition is almost 170mb (seen by df -h command) and when i try to copy it, the destination directory is about twice its original size!! How's that possible?
|
Since ISO9660 is a readonly file system, you can do a number of tricks there that you wouldn't normally do on another file system. ISO9660 allows, for instance, to have multiple directory pointing to the very same file, i.e. to the same block number. That would appear very similar to hardlinks on a native Linux file system. As soon as you copy the contents, you get two separate files and twice the space allocated.
Could that be the issue here?
[X] Doc CPU
PS: This isn't a dumb question!
|
|
|
05-23-2012, 04:53 AM
|
#3
|
LQ Newbie
Registered: May 2012
Posts: 5
Original Poster
Rep:
|
Quote:
Originally Posted by Doc CPU
Hi there,
what file system do you have on the USB drive? - Possibly doesn't matter, but I notice you didn't give that information.
Since ISO9660 is a readonly file system, you can do a number of tricks there that you wouldn't normally do on another file system. ISO9660 allows, for instance, to have multiple directory pointing to the very same file, i.e. to the same block number. That would appear very similar to hardlinks on a native Linux file system. As soon as you copy the contents, you get two separate files and twice the space allocated.
Could that be the issue here?
[X] Doc CPU
PS: This isn't a dumb question!
|
First of all thanks for the reply!
The filesystem on my pen drive is ext3 (made with mke2fs -j /dev/sdb1) but i tried also with ext2 FS type.
I think it could be possible that there are multiple directory pointing.. I've never thought that.. i don't know much about iso9660 filesystem...
All i wanted to do is have an image of the cdrom on my pendrive, but in read write mode so i'm able to edit files in the cdrom. After that i'd put all files in another iso (probably with mkisofs) to have a modified version of the cdrom.
Any suggestion?
Thanks again!
Last edited by simonspt; 05-23-2012 at 04:57 AM.
|
|
|
05-23-2012, 05:38 AM
|
#4
|
Senior Member
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099
|
Hi there,
Quote:
Originally Posted by simonspt
All i wanted to do is have an image of the cdrom on my pendrive, but in read write mode so i'm able to edit files in the cdrom. After that i'd put all files in another iso (probably with mkisofs) to have a modified version of the cdrom.
|
as far as I can tell, that leaves you with two options: - Don't care and just accept that you'll need more space
- Find out which files are identical, copy just one instance of them and hardlink them among each other
Each of the two has its drawbacks. With method 1, you need to take care that you edit every file of a supposedly identical pair or triple, while method 2 is more effort to analyze, and you have to spend more attention on recreating the ISO with these linked files.
[X] Doc CPU
|
|
|
05-23-2012, 12:36 PM
|
#5
|
LQ Newbie
Registered: May 2012
Posts: 5
Original Poster
Rep:
|
I solved by creating a bigger ext3 partition on my pendrive... Well.. not so useful because now the partition takes about a 30% of my 1gig pendrive, vs the 10% usage of iso9660 partition...
That's it! :-)
thanks Doc!
|
|
|
All times are GMT -5. The time now is 08:24 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|