Score:1

Can I umount root '/' to make an iso file of root partition?

ru flag

I have Ubuntu installed on /dev/sda1 and an external USB disk mounted in /mnt/backup.

I want to make an iso file of my /dev/sda hard-disk, and for this I planned to use

dd if=/dev/sda of=/mnt/backup/hd.iso $option

I can't boot from external devices, so I was wondering if there is an option to umount the partition currently mounted in /, or make it read-only, so that dd will store a consistent state of the disk.

Pilot6 avatar
cn flag
There is no such command obviously.
ChanganAuto avatar
us flag
And you should do it from a live session, not from the running system
raj avatar
cn flag
raj
Maybe you can try booting in single user/recovery mode, by modifying boot options, so that you stop booting at early stage, when root filesystem is checked. It is then mounted read only. If you are able to run `dd` at that stage, you may want to achieve what you need. Other than that, I see no option. Usually this is done by booting from external devices.
ru flag
@raj this looks to me as a valid way. Unfortunately when booting with single user and then dropping down to a root shell, I see the filesystem has been already remounted `rw`, and even killing all processes but kernel's and the current bash, the mount point `/` remain `busy` to be remounted `ro`
Score:1
cn flag

You shouldn't umount the root partition. Doing so will takes you to a system where you can't open files, detect new hardware or even remounting the root partition again. At this point, your system doesn't know what /dev means and you can only shootdown and reboot.

In order to dd your root partition, if you can't boot from external devices, I'm afraid you're almost out of aces. Could you try to attach your HDD/SDD to another system?.

Sure you can umount the root partition just for fun, but DON'T mess around with this:

# umount -lf /
ru flag
You identified a very good point; if there is no `/` there is not even `/usr/bin/dd`. So I really need to have it (re)mounted read-only. I can't physically detach my nvme
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.