Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
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.
It depends. You can try mounting the partition as ext3 and if that works that is nothing else you need to do.
Otherwise, mount the ext4 file system with the “noextents” mount option, copy the extent-based ext4 files to new files, rename these over the old extents, use tunefs to clear the INCOMPAT_EXTENTS flag, and then remount as an ext3 file system.
Another option would be to copy the files to another partition, reformat as ext3 and copy the files back.
I have to admit I didn't know the relevant differences between ext3 and ext4, so I searched for them and all the information indicates that ext4 is more capable, probably because it is newer.
Therefore I concur with michaelk about asking why you would want to change?
I'd create an entirely new raspbian card using ext3 and copy the relevant contents over to it and then set aside the ext4 one, or re-purpose it.
But I think somehow I have given the wrong handle as to what I was looking for.
This is what I wrote
Quote:
I want to reinstall an rpi image onto a sdcard - raspbian.
I know how to do this using the dd command, however, what I would like is to change the filesystem of the partition it creates from ext4 to ext3.
How would this be done?
I have a feeling the "...I want to change the filesystem of the partition it creates." caused the confusion. But the first sentence did state that it was to do with installing an image using the dd command.
So what I would like is for the dd command via the installing of the image to not create an ext4 filesystem but a ext3 filesystem. Obviously once the image/iso is installed the underlying filesystem is ext4, which is what I am looking to change - and yes you can change much to my surprise via fstab the filesystem - but this does not change the underlying install filesystem. From what I can gather ext3 is handled by ext4 so is probably why you can change the filesystem in fstab and get awau with it.
In the meantime I think I will take apart an iso to see how it works.
But I think somehow I have given the wrong handle as to what I was looking for.
This is what I wrote
I have a feeling the "...I want to change the filesystem of the partition it creates." caused the confusion. But the first sentence did state that it was to do with installing an image using the dd command.
So what I would like is for the dd command via the installing of the image to not create an ext4 filesystem but a ext3 filesystem. Obviously once the image/iso is installed the underlying filesystem is ext4, which is what I am looking to change - and yes you can change much to my surprise via fstab the filesystem - but this does not change the underlying install filesystem. From what I can gather ext3 is handled by ext4 so is probably why you can change the filesystem in fstab and get awau with it.
In the meantime I think I will take apart an iso to see how it works.
The difference between ext3 and ext4 is essentially the feature set. Both are actually handled using the same driver in Linux. So, if you want to effectively convert an ext4 filesystem into an ext3 one (you still haven't explained exactly why you would want to do this, a datum that would influence the answers here), you should turn off all the filesystem's ext4 features using tune2fs. Such features include 64bit, bigalloc, dir_nlink, extent, extra_isize, flex_bg, huge_file, mmp, quota, and uninit_bg.
As far as I am aware, this can't be done with the dd command.
I know how to do this using the dd command, however, what I would like is to change the filesystem of the partition it creates from ext4 to ext3.
dd is copying an IMAGE, so the filesystem will be exactly the same fs of where you're taking the image FROM. It is just a byte by byte copy of the original. The dd program doesn't know anything about the internal organisation, i-node contents and other fs-specific things, so to get a ext3 destination you have to start by creating an ext3 original first.
Or, of course, do not use dd at all as it cannot do what you want, but i.e. rsync (which is a file by file copy, not an image one).
Now there's an idea - but it is a hack Something worth considering though
We must have different definitions of a "hack" then. It is simply a means of achieving your goal.
Of course the method I would use or recommend would depend on your reasons for wanting to convert from ext4 to ext3, which you still haven't provided, despite the information being requested from you.
As stated using the dd in this instance copies bytes from source the image file to destination the SD card and nothing more. dd does not create anything.
The downloaded Raspbian image file is the complete operating system. It is a copy of a drive that contains the MBR and several partitions. Again, the easiest way to change ext4 to ext3 would be to copy the files to another location, reformat the partition and copy the files back to the SD card.
It is also possible to in install Raspbian from scratch instead of using a pre-installed image file.
So what I would like is for the dd command via the installing of the image to not create an ext4 filesystem but a ext3 filesystem.
While the dd command description says that it will copy and convert a file, the types of conversion are not what you're looking for, from the dd command.
Quote:
Originally Posted by slackbat
From what I can gather ext3 is handled by ext4 so is probably why you can change the filesystem in fstab and get awau with it.
Sounds like a hack to me
Quote:
Originally Posted by slackbat
In the meantime I think I will take apart an iso to see how it works.
Sounds as if you no longer with to accomplish your goal using the dd command. Best of luck with your take apart of an ISO.
We must have different definitions of a "hack" then. It is simply a means of achieving your goal.
Of course the method I would use or recommend would depend on your reasons for wanting to convert from ext4 to ext3, which you still haven't provided, despite the information being requested from you.
While the dd command description says that it will copy and convert a file, the types of conversion are not what you're looking for, from the dd command.Sounds like a hack to me Sounds as if you no longer with to accomplish your goal using the dd command. Best of luck with your take apart of an ISO.
Let me explain. Often here on LQ, and I mean it happens a lot, someone comes on asking how to do something. But, in effect, they have experienced a problem and have themselves decided on a solution - what they want to do is know how to implement that particular solution.
However, it then transpires after some questioning that the "how" should have been a "why". On asking the poster why they want to do that thing, it is figured out that the solution they decided upon, using dd in your case, is not the best solution.
The whole idea is to step back and view the problem in its most basic form. That gives you clarity on the potential solutions. It is for that reason that you are being asked why you want to achieve what you want to achieve. We're trying to help you.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.