Set internal hard drives unaccessible to imager


 
Thread Tools Search this Thread
# 1  
Old 01-20-2012
Set internal hard drives unaccessible to imager

Looking for some clues on how to set my internal hard drives inaccessible/busy to clonezilla. Noprobe doesn't work in startup and the drive is still found.

I know I can find all hard drives using the following:

Code:
sudo fdisk -l | grep GB | awk '{print $2}' | grep -Po "^[^:]+(?=:?)"

I tried mounting the drive to make it busy and inaccessible to clonezilla but the fs can't be determined. It is a windows xp install but it is also encrypted on bootup. I tried vfat, ntfs, ntfs-3, etc with no luck.

So another option is how do I make clonezilla not probe internal hard drives? I'm unfamiliar with recompiling source code and hope it doesn't come to that to disable hdd controllers.
# 2  
Old 01-20-2012
You can rule out a lot of internal hard disk controllers by preventing ahci.ko from loading, if that's built as a module and not built-in. This also rules out a lot of internal cdroms though.

You could try disabling your hard-drive controller in the BIOS.

If you're able to run any commands on the clonezilla disk before clonezilla starts doing things, how about chmod 000 /dev/sda* ? Might fail if clonezilla runs everything as root, but worth a shot.

You could also use a machine with no internal hard drives!
# 3  
Old 01-20-2012
thanks corona - I'll take a look at it after lunch.

Basically I have no issue showing the hard drives to myself but I worry about people overwriting their hard drive when using a usb stick I'll distribute to them. I need to make it as dummyproof as possible.
# 4  
Old 01-20-2012
Hmmm. Does the liveusb use udev? You could configure udev to prevent it from creating certain kinds of device nodes. Without those, clonezilla would be unable to use the disk.

For example there's a default rule on my system for USB devices:

Code:
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"

You could flip that a bit:
Code:
KERNEL=="sd*[!0-9]|sr*", SUBSYSTEMS!="usb", NAME="skipme/%k"

Make sure that rule runs really early, naming the new rule file lower than everything else. 00-customrules perhaps.

I think that would create any non-USB disk or CDROM devices inside /dev/skipme/sd... and cause it to not create the ordinary /dev/sd... device nodes. If clonezilla uses them to detect disks, it won't find non-USB devices.

Last edited by Corona688; 01-20-2012 at 03:02 PM..
# 5  
Old 01-20-2012
found it under /etc/udev/rules.d/z60_hdparm.rules

this file is extracted on startup of live cd so I would have to change the source image to reflect changes
# 7  
Old 01-20-2012
I unsquashed the file and am looking at it:

Code:
ACTION==="add", SUBSYSTEM=="block", KERNEL=="[sh]d[a-z]", RUN+=/etc/init.d/hdparm hotplug

would I just replace
KERNEL=="[sh]d[a-z]"

with
KERNEL=="sd*[!0-9]|sr*", SUBSYSTEMS!="usb", NAME="skipme/%k"

not sure never messed with custom udev rules
 

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
Need Hardware help on a RP4440 that lost the RTC and does not see both hard drives mrmurdock HP-UX 2 2 Weeks Ago 02:22 PM
Understanding volumes and hard drives cptkirkh UNIX for Beginners Questions & Answers 5 01-04-2019 05:34 PM
Solaris 8 - Accessing Hard Drives ssabet Solaris 5 12-15-2016 03:26 AM
Hard Drives Undetected on My Machine - But Mounts on All Other Machines jacobs.smith Ubuntu 20 08-18-2015 03:35 PM
Create LVM of 2 Hard Drives while installing Centos 6.4. purushottamaher Linux 1 04-28-2014 06:40 AM
Trying to boot Solaris without hard drives in T5220 nerdboy Solaris 4 09-03-2013 05:04 PM
Hard Drives and MBR Lost in Cyberia Hardware 3 06-04-2013 06:28 PM
Reinstall old hard drives stu1811 Solaris 7 05-04-2013 10:58 AM
How to set server's ip address, router, network mask and set if it is an internal or external ip? zagaruika UNIX for Dummies Questions & Answers 4 11-17-2010 09:44 AM
Help adding new hard drives Katkota Filesystems, Disks and Memory 3 10-10-2009 04:57 PM
formating and repartitioning an external hard drives seyiisq Solaris 2 05-18-2009 08:22 AM
Opinions on Internal SCSI Tape Drives for FreeBSD home server? Aaron Van Filesystems, Disks and Memory 3 09-24-2008 10:51 AM
No Hard Drives Have Been Found tamcomng Linux 2 07-21-2008 08:30 AM
automatic copying files from external hard drives backman4sakn Filesystems, Disks and Memory 0 08-12-2005 06:11 PM
Hard drives franruiz UNIX for Dummies Questions & Answers 3 01-13-2004 05:13 PM