severity 802636 normal tag 802636 + moreinfo thanks Imam Kurniawan wrote: > First, I do apologize if I have put this into the wrong category of bug > report. > Because I have to submit the package name, which is sync command is from the > coreutils package. > But it definitely related with Debian ISO image, too.
I read the report in detail. I do not believe this is a bug in either cp or sync. I have therefore downgraded the severity of this report. > >From these Installation Guide pages: > https://www.debian.org/releases/stable/i386/ch04s03.html.en > https://www.debian.org/releases/stable/amd64/ch04s03.html.en > > We only need 2 commands to make a bootable USB stick: > # cp debian.iso /dev/sdX > # sync > > These were what I use to make a bootable USB stick: > - 1 TB external hard disk with two partitions (1 GB formatted with NTFS and > the > rest of space formatted with EXT4). > - 8 GB flashdisk. > > These were the steps what I did: > - I have Debian ISO image in my external hard disk, in the EXT4 partition > (source). > - I would like to make a bootable USB stick on my flashdisk (destination). Okay. > - I did cp command (debian-8.2.0-amd64-DVD-1.iso) from external hard disk to > the flashdisk, both of them exactly via USB connection. > - Then I did sync command. What was the exact command you ran verbatim? Of most importance is knowing what device names you used in the copy. > After that, both of them became bootable USB! > I lost the partitions and data in my external hard disk. They won't be > displayed, because already became a Debian USB installer. If that is true then you mistakenly copied the iso image on top of your 1TB external hard disk and overwrote data there. I think it most likely that you used the device name of the 1T disk as the target of the cp command instead of the 8G flash usb storage. > I'm afraid if I restore the partition in my external hard disk, all the data > would become corrupt. I fear you have already overwritten the contents of the external hard disk by the size of the iso file copied over it. Because your NTFS was first on the disk it was mostly overwritten and is why it is more lost. If the size of the ISO image is smaller than the NTFS partition then it will have stopped overwriting before reaching the ext4 partition and the ext4 partition will be okay once the partition table is restored. > I don't know this problem is related with the coreutils package or Debian ISO > image. > But it would happen if use those commands when the ISO source from the USB > connection, too. > Then both of the USB drives would become bootable. > > This problem doesn't explained at the Installation Guides page. At least, > someone has tried before me. > It could be a big mess for an end user, partition and data loss at USB source. I do not believe this is a bug in the software which is why I downgraded the severity. I fear you have misunderstood the documentation describing /dev/sdX to be the target device you wish to copy onto and replaced /dev/sdX with the device name of your 1T external USB hard disk. Instead it should have been the device name of your USB 8G flash storage device. Assuming *three* devices attached to your system then /dev/sda would be the disk you booted from, /dev/sdb would be the next discovered USB device, /dev/sdc would be the next discovered USB device after that point. Because you are using USB devices which are hotplugged devices the names will be dynamically assigned in the order in which the devices were plugged into the system. You would always need to look in detail to determine which one is which one and use the correct one. It is easier with only one USB device. Because then /dev/sda is almost always the boot device and /dev/sdb would be the additional USB device. (Usually. Because of the way Linux assigns names this may not always be true and should always be verified.) In your case of using two USB devices then the device names are assigned in order of installation and may be different. Bob