April 22, 2019

Become A System Rescue Guru With Linux, Part 2 - page 2

Network Rescue

  • May 22, 2008
  • By Carla Schroder
SystemRescue CD even rescues Windows, both FAT filesystems and NTFS. There is a bit of misinformation about NTFS support in Linux being unsafe, but thanks to NTFS-3G Linux supports both reading and writing to NTFS safely.

If all you want to do is copy files from an NTFS partition, go ahead and mount the partition read-only:

%  mkdir /mnt/ntfs
%  mount -t ntfs /dev/sda2 /mnt/ntfs -o ro
Using your own device name, of course, which you can find with fdisk -l. ls /mnt/ntfs then displays your Windows files. Then you can copy the files to an existing Samba share. If you need to find your Samba shares, use smbtree:
% smbtree -N
  \\XENA                       anonymous file server
       \\XENA\HP_LaserJet_3050 HP_LaserJet_3050
       \\XENA\IPC$             IPC Service (anonymous file server)
       \\XENA\common_share     anonymous share for all users
-N means don't ask for a password. If you need a password don't use -N. This example shows a single Samba server with a single file share, common_share, in the workgroup GROUP1, on host Xena. Next, mount this share on your SystemRescueCD computer, and mind your slashes:
% mkdir /mnt/commonshare
% mount.cifs //xena/common_share /mnt/commonshare
% cd /mnt/commonshare
Now you can copy files back and forth with the cp command. If you have enough disk space on your Samba server you can grab the entire Documents and Settings folder, which holds the data files of all the local Windows users:
% cp -r /mnt/ntfs/Documents and Settings/ .
The trailing dot is a shortcut for "current working directory". The easy way is to use tab-completion, so after typing "Doc" hit the tab key and it will auto-complete the file name. It will also enter backslashes, so it looks like this:
/mnt/ntfs/Documents\ and\ Settings/

If you want to edit some Windows files, then you need to use the NTFS-3G driver:
% ntfs-3g /dev/sda2 /mnt/ntfs
Then you have several text editors to choose from: vim, Joe, nano, qemacs, and zile for the console, and Leafpad and Gvim for WindowMaker. It also includes a hex editor, hexedit.

Most Popular LinuxPlanet Stories