LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-22-2012, 08:17 PM   #1
simonspt
LQ Newbie
 
Registered: May 2012
Posts: 5

Rep: Reputation: Disabled
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!
 
Old 05-23-2012, 04:46 AM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by simonspt View Post
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 View Post
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!
 
Old 05-23-2012, 04:53 AM   #3
simonspt
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Doc CPU View Post
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.
 
Old 05-23-2012, 05:38 AM   #4
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
Hi there,

Quote:
Originally Posted by simonspt View Post
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:
  1. Don't care and just accept that you'll need more space
  2. 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
 
Old 05-23-2012, 12:36 PM   #5
simonspt
LQ Newbie
 
Registered: May 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
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!
 
  


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
[SOLVED] Files seem to take up more space in destination after rsync copy Karderio Linux - Newbie 6 09-22-2014 08:41 PM
copy files from one source to multiple destination simultaneously mdfakkeer Linux - Software 3 08-10-2010 04:25 PM
copy files from one source to multiple destination simultaneously mdfakkeer Programming 7 08-06-2010 08:05 AM
Copy files from various locations to a single destination folder deostroll Linux - Newbie 5 05-13-2009 07:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:24 AM.

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
Open Source Consulting | Domain Registration