Tuesday, April 5, 2016

partitioning - Error creating bootable USB using "cat file.iso > /dev/sdb"



At first, I had this USB flash drive with a Ubuntu 14.04 LTS bootable in it. But now, I want to remove/wipe it and create a new bootable of another OS.
First, I tried directly:



sudo cat file.iso > /dev/sdb; sync


As suggested in this thread. It didn't worked, returned





bash: /dev/sdb: Permission denied




So, I thought that this was happening because of it already containing a bootable and decide to wipe it. So I just shreded it



sudo shred -v /dev/sdb



After it, It wasn't appearing on the nautilus vertical nav as I sticked it into PC. So I made a file system for it sudo mkfs.ext3 /dev/sdb (I don't know if it's the right type of fs to make it but I was just testing anyway, if it isn't, please warn me about this)




Now, I access it through nautilus and I see that it is indeed empty. I'm trying to make that command I was doing in the beginning sudo cat file.iso > /dev/sdb; sync but still having the same "permission denied" again.



So, two questions on that, did this mkfs was applied correctly or I shouldn't do that? And, how do I solve my problem of making my bootable iso finally? (I don't want to use unetbootin, couldn't install it and I read that it could be done using cat/sync) Thanks in advance.



The command you try



sudo cat file.iso > /dev/sdb; sync


would, if it does what you expect, completly overwrite the usb drive. So there is no need / no sense to create a ext3 filesystem on it before.




Your mkfs.ext3 command in a sense is fine.



The actually cat command will not work because the sudo command runs as root but the redirection of the output does not. A simple way to get it working is



sudo dd if=file.iso of=/dev/sdb bs=16k; sync


As this doesn't use output redirection there is no problem with sudo.




This is mentioned as the "retro way" in the question you linked to.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...