LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 10-23-2018, 06:01 AM   #1
slackbat
Member
 
Registered: Dec 2005
Location: Mid-West-Wales
Distribution: Slackware 14.2_64_multilib - Salix 14.2 - devuan
Posts: 142

Rep: Reputation: 27
determining filesystem type with dd command


Hi all

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?

Cheers
 
Old 10-23-2018, 07:28 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,814

Rep: Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959
Why do you want to change the filesystem?

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.
 
1 members found this post helpful.
Old 10-23-2018, 08:05 AM   #3
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,885
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
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.
 
Old 10-25-2018, 04:11 AM   #4
slackbat
Member
 
Registered: Dec 2005
Location: Mid-West-Wales
Distribution: Slackware 14.2_64_multilib - Salix 14.2 - devuan
Posts: 142

Original Poster
Rep: Reputation: 27
Thank you for your replies.

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.
 
Old 10-25-2018, 04:31 AM   #5
slackbat
Member
 
Registered: Dec 2005
Location: Mid-West-Wales
Distribution: Slackware 14.2_64_multilib - Salix 14.2 - devuan
Posts: 142

Original Poster
Rep: Reputation: 27
Quote:
Originally Posted by rtmistler View Post
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.
Now there's an idea - but it is a hack Something worth considering though
 
Old 10-25-2018, 06:44 AM   #6
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by slackbat View Post
Thank you for your replies.

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.

Last edited by hydrurga; 10-25-2018 at 06:48 AM.
 
Old 10-25-2018, 06:46 AM   #7
ehartman
Senior Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 1,674

Rep: Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888Reputation: 888
Quote:
Originally Posted by slackbat View Post
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).
 
1 members found this post helpful.
Old 10-25-2018, 06:54 AM   #8
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by slackbat View Post
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.
 
Old 10-25-2018, 07:28 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,814

Rep: Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959Reputation: 5959
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.

https://www.raspbian.org/RaspbianInstaller

Last edited by michaelk; 10-25-2018 at 08:45 AM.
 
Old 10-25-2018, 09:00 AM   #10
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,885
Blog Entries: 13

Rep: Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931Reputation: 4931
Quote:
Originally Posted by slackbat View Post
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 View Post
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 View Post
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.
 
Old 10-26-2018, 05:37 AM   #11
slackbat
Member
 
Registered: Dec 2005
Location: Mid-West-Wales
Distribution: Slackware 14.2_64_multilib - Salix 14.2 - devuan
Posts: 142

Original Poster
Rep: Reputation: 27
Quote:
Originally Posted by hydrurga View Post
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.
I am not here to argue.
 
Old 10-26-2018, 05:38 AM   #12
slackbat
Member
 
Registered: Dec 2005
Location: Mid-West-Wales
Distribution: Slackware 14.2_64_multilib - Salix 14.2 - devuan
Posts: 142

Original Poster
Rep: Reputation: 27
Quote:
Originally Posted by rtmistler View Post
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.
And again misinterpreted.

I am not here to argue.
 
Old 10-26-2018, 08:07 AM   #13
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
Quote:
Originally Posted by slackbat View Post
I am not here to argue.
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.

It is known as the XY Problem:

https://meta.stackexchange.com/quest...the-xy-problem
 
1 members found this post helpful.
  


Reply



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
Determining AP type nix84 Linux - Networking 2 05-16-2014 10:28 PM
What command can ID filesystem type hard drive? dwbrown44 Fedora 4 02-02-2007 04:44 PM
Determining filesystem type in use chriscore Linux - Newbie 6 03-22-2005 08:19 PM
Is there a command for finding out the filesystem type? nodger Linux - Software 2 03-04-2005 03:04 PM
command line for determining memory type jdier Linux - Newbie 1 06-10-2004 09:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:16 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
Open Source Consulting | Domain Registration