LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-02-2015, 08:39 AM   #1
Ali3n0id
LQ Newbie
 
Registered: Nov 2014
Distribution: Mint, Raspbian, Ubuntu 14
Posts: 24

Rep: Reputation: Disabled
Keeping files on a obsolute linux system drive


I want to keep a large amount of files (1TB) I have on a linux install that I no longer require. The files are on a USB 3 2TB drive where the OS is installed alongside it. I no longer require said install but keep the files downloaded still and use it as a Samba share whilst still keeping the ext4 file system if possible. I don't have another hard drive I can copy this amount of data to so that is not possible.

What's the most elegeant/easy method to do this please?

Many thanks in advance.
 
Old 03-02-2015, 09:27 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
a 3TB disk will bring out the magpie in any of us. I have heard of people storing gigabytes of information considering it 'valuable'. Linux is in development, so all software goes out of date. Photos, videos, etc are avidly recorded and stored, but rarely are they avidly watched. In short most of this data fails the test of time.

You sound as if you are doing just fine with the data, and I don't know what your problem is. Maybe you would be able to do a rm-rf on the linux install if you are sure it will not be needed.
 
Old 03-02-2015, 10:00 AM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Is there a question in here?

What is the most elegant/easy method to do what, exactly? Keep the files that are on your external HDD on your external HDD and continue using it as you already are?
 
Old 03-02-2015, 12:34 PM   #4
Ali3n0id
LQ Newbie
 
Registered: Nov 2014
Distribution: Mint, Raspbian, Ubuntu 14
Posts: 24

Original Poster
Rep: Reputation: Disabled
I want to keep the contents of '/home/user/downloads' but deleting everything else under '/', is using 'rm -rf' the recommended method for this?
 
Old 03-02-2015, 12:56 PM   #5
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142Reputation: 2142
Just move everything in /path/to/mount/point/home/user/downloads to a new directory on the root level of the drive (/path/to/mount/point/data or something) and then "rm -fr" all other directories on the drive.

Last edited by suicidaleggroll; 03-02-2015 at 12:59 PM.
 
Old 03-02-2015, 03:39 PM   #6
Ali3n0id
LQ Newbie
 
Registered: Nov 2014
Distribution: Mint, Raspbian, Ubuntu 14
Posts: 24

Original Poster
Rep: Reputation: Disabled
Perfect, not pretty but I'll give it a shot. Thank you both!
 
Old 03-03-2015, 03:32 AM   #7
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,260

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
You can also use the approach
rm -rf /{bin,dev,etc,lib,lib64, . . . . . ,var}
That will leave you /home. then get picky there. I would personally move your downloads to another partition and just use rm -rf , but be very careful to move to the right directory. Root is "God" in a system. If you run rm -rf on /, you are in for a reinstall, and all your data is gone. Don't do a 'Sodom & Gomorrah'(the ultimate rm -rf on your own system.

I much prefer no leading slashes on a rm -rf. rm -rf sbin - yes. rm -rf /sbin - never.

Last edited by business_kid; 03-03-2015 at 03:33 AM.
 
Old 03-06-2015, 01:50 PM   #8
Ali3n0id
LQ Newbie
 
Registered: Nov 2014
Distribution: Mint, Raspbian, Ubuntu 14
Posts: 24

Original Poster
Rep: Reputation: Disabled
Thank you gentlemen I just moved the drive to another linux box and rm -rf all directories apart from 'Downloads'. Easy as 'Pi'.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete files keeping the files listed in a text file -urgent jeesun Linux - General 4 10-21-2011 11:28 AM
changing System keeping HD w/ linux installed alejandroye Linux - Hardware 3 06-02-2006 03:05 PM
Drive names not keeping... hongman Linux - Newbie 1 02-27-2005 08:43 AM
creating a system files on an external drive zaza Linux - Newbie 2 05-03-2002 04:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration