Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: Eddiie on August 15, 2019, 02:02:23 AM
-
Hello,
I want to use TC to simply run from a USB stick and erase any partitions that exist on a connected hard disk (fdisk -l shows it as /dev/sdb, make 2 new Linux partitions and exit (or loop indefinitely).
Is this possible with TC? My searches have found "almost" answers but it seems the OP wants to do more than simply delete any existing partitions and make some new one's.
Appreciate any help!
-
Hi Eddiie
It sounds like you want to automatically repartition the drive upon boot up and then wind up at a command line (or GUI) to perform
other actions. You already installed Tinycore to a USB stick, right? Open your /opt/bootlocal.sh file and add the following:
fdisk /dev/sda <<EOF
commands
EOF
Replace commands with the actual keystrokes you would use when running fdisk, for example:
fdisk /dev/sda <<EOF
p
n
p
1
---~ SNIP ~---
p
w
EOF
-
Thank you! Very cool.
Actually, I am going to use dd to wipe -
dd if=/dev/urandom /dev/sda bs=512 count=1 conv=notrunc
and fdisk to create -
fdisk /dev/sda <<EOF
u
n
p
1
2
1000
n
p
2
1000
w
EOF
fdisk -l
Now to finger out how to make this persist on to the Flash drive and create a new ISO from it.
-
Hi Eddiie
... Now to finger out how to make this persist on to the Flash drive and create a new ISO from it.
You need to run a backup. If you're using a GUI, clicking the Exit icon then OK should run a backup. From the command line:
filetool.sh -b
I would highly recommend you take an hour to read this fine book:
http://tinycorelinux.net/corebook.pdf
-
I got it working. So cool. Reading through wiki and FAQs etc.
To save the settings I wound up creating a EXT2 partition and redirected opt= to that location in boot file I think it was...
I used the core-plus.iso to install on to a removable media. Using 64bit.
Is there anything I should post here to help others?
Thank you for the guidance.
-
Hello,
I want to use TC to simply run from a USB stick and erase any partitions that exist on a connected hard disk (fdisk -l shows it as /dev/sdb, make 2 new Linux partitions and exit (or loop indefinitely).
This sounds extremely dangerous! And possibly illegal?
[emoji15]
Sent from my iPhone using Tapatalk
-
That's one reason one should *never* try to use an abandoned usb stick laying around somewhere for booting, or even for simple internal inspection unless you have a forensic box.
-
This poses an interesting situation for a utility like this --
Would the protect boot code - even though you aren't protecting anything at this point - come on early enough in the boot process to only allow those who know the password to proceed?
Say for instance in a recycling facility where something like this could be used by the unskilled who are trying to do the right thing by erasing previous user's data.
All they have to know is one thing - the protect password / passphrase to continue..
Or would protect come on too late in the process?
-
This poses an interesting situation for a utility like this --
Would the protect boot code - even though you aren't protecting anything at this point - come on early enough in the boot process to only allow those who know the password to proceed?
Say for instance in a recycling facility where something like this could be used by the unskilled who are trying to do the right thing by erasing previous user's data.
All they have to know is one thing - the protect password / passphrase to continue..
Or would protect come on too late in the process?
Hi, PDP-8!
I think you are talking about setting good password for tc user and "noautologin" bootcode?
-
dd if=/dev/urandom /dev/sda bs=512 count=1 conv=notrunc
This was helpful for me, but I had to add of=
dd if=/dev/urandom of=/dev/sda bs=512 count=1 conv=notrunc
I intend to protect users from inadvertently wiping disks with:
read -r -p "Are you sure? [y/N] " response
response=${response,,} # tolower
if [[ "$response" =~ ^(yes|y)$ ]]